To get just the IP address of your Internet facing Linux machine, use this command. [email protected]:~/Documents/ipinfo/src$ curl [email protected]:~/Documents/ipinfo/src$ curl icanhazip.com This will return just your IP address. This is another way to get this information. [email protected]:~/Documents$ curl [email protected]:~/Documents$ curl ipinfo.io/ip To get information about a DNS server, use the dig command. [email protected]:~/Documents/ipinfo/src$ dig 8.8.8.8   …

This command will add an IP route to the 172.29.59.1 router using the wlan0 wireless interface card on my laptop. [email protected]:~$ sudo ip route add 0/0 via 172.29.59.1 dev [email protected]:~$ sudo ip route add 0/0 via 172.29.59.1 dev wlan0 This is part of the process of creating a network connection from your machine to a …

This is how you find out the gateway IP address of your Linux machine on a LAN. I have executed the route -n command and I have this output. The UG flags on the IP address denote it as a gateway IP address. [email protected]:~# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric …

The ip command is a useful alternative to the ifconfig command and allows the user to manage network interfaces. This is a good way to use the command line to bring network interfaces up or down. In this example I am bringing the network interface down. [[email protected] jason]# ip link set eno16777736 down [[email protected] jason]# …

There are a few commands available in Red Hat Linux to get information about your network adapter. Here are a couple. The ifstat command returns information about the network throughput of your adapter. [[email protected] ~]$ ifstat #kernel Interface RX Pkts/Rate TX Pkts/Rate RX Data/Rate TX Data/Rate RX Errs/Drop TX Errs/Drop RX Over/Rate TX Coll/Rate lo …

To set an IP address on a VLAN on a Cisco switch, firstly access the configuration section for the VLAN in configuration mode. arya(config)#interface vlan 1arya(config)#interface vlan 1 Then the administrator may set an IP address for the VLAN. arya(config-if)#ip address 172.18.31.210 255.255.255.0arya(config-if)#ip address 172.18.31.210 255.255.255.0 Then you are all set. To save the running …

To scan a network for hosts using Kali Linux, the netdiscover command will come in handy. Just give it an IP address and it will find all hosts within that range. I am scanning for all hosts within the range of 172.29.59.1 to 172.29.59.254. [email protected]:~/Documents# netdiscover -r 172.29.59.0/24   Currently scanning: Finished! | Screen View: …

This program will return the IP address of a specified network interface. Use the –ip parameter to get the IP. For example, this will show the IP address of an ethernet interface: ./a.out –ip eth0. #include <stdio.h> #include <string.h> /* for strncpy */ #include <unistd.h> // for close #include <sys/types.h> #include <sys/socket.h> #include <sys/ioctl.h> #include …

Adding an IP address to the management interface of a Cisco switch allows connection over an Ethernet connection to manage the switch configuration. Firstly, switch to privileged exec mode. tyrion>en tyrion#tyrion>en tyrion# Then enter the configure terminal command to configure terminal settings. tyrion#configure terminaltyrion#configure terminal Now we are configuring settings for vlan 99. tyrion(config)#interface vlan …

This command will lookup the network adapter that you are using and return your network address. [email protected]:~$ arp -n | grep : | awk ‘{print $1}’ [email protected]:~$ arp -n | grep : | awk ‘{print $1}’ 10.10.0.1 This looks for the : character that is in the MAC address like this. [email protected]:~$ arp -n Address …

Get your gateway IP address with curl on the command line. [[email protected] ~]$ echo $(curl -# http://ipecho.net/plain) ######################################################################## 100.0% 153.107.97.164[[email protected] ~]$ echo $(curl -# http://ipecho.net/plain) ######################################################################## 100.0% 153.107.97.164 Another way to list the IP addresses of your network interfaces. Using the ip command. [[email protected] ~]$ ip a | grep inet* inet 127.0.0.1/8 scope host lo …

Linux has quite a few commands for finding out information about your network adapters. Below is an example. Using the ethtool command as root. [email protected] ~ $ sudo ethtool eth2 [sudo] password for homer: Settings for eth2: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Supported pause frame use: No …

The sipcalc command is very useful for calculating an IP subnet. This command shows the amount of hosts available for a given subnet. [email protected]:/home/homer# sipcalc 192.168.100.1/24 -[ipv4 : 192.168.100.1/24] – 0   [CIDR] Host address – 192.168.100.1 Host address (decimal) – 3232261121 Host address (hex) – C0A86401 Network address – 192.168.100.0 Network mask – 255.255.255.0 …

How to get the geographical location of an IP address. This simple command will get this for you. [[email protected]:~] curl ipinfo.io/203.113.124.148 ; echo "" { "ip": "203.113.124.148", "hostname": "No Hostname", "city": "", "region": "", "country": "TH", "loc": "13.7500,100.4667", "org": "AS9737 TOT Public Company Limited" }[[email protected]:~] curl ipinfo.io/203.113.124.148 ; echo "" { "ip": "203.113.124.148", "hostname": "No …

This simple one liner will print out your IP address and then IPv6 equivalent if you have it set. [[email protected] ~]$ ifconfig enp6s1 | awk ‘/inet/ { print $2 } ‘ | sed -e s/addr:// 192.168.1.2 fe80::213:46ff:fe3a:283 Here is a way to only print the IPv4 address. [[email protected] ~]$ ifconfig enp6s1 | awk ‘/inet / …