If you are a Kali Linux user, You may need the IP address for many reasons. While performing penetration testing or security audits, you have to hide your IP, or you may need it for several other purposes. Every time you connect to the internet, your IP address changes.
Let’s find out different ways of finding your IP address.
Also read: Linux ifconfig command
What is an IP address?
IP address stands for Internet Protocol address. It is a unique identification number used to identify a network or device on the internet. It is used for communication between devices as well as between networks.
It has been characterized as “A name indicates what we seek, An address indicates where it is. A route indicates how to get there”. Information is shared in the form of IP packets that contain both the sender’s and receiver’s IP addresses.
There are two versions of Internet Protocol: IPv4 and IPv6. IPv4 is the fourth version of IP that was launched back in 1983. When a device is connected to the internet, it is assigned a unique IP address such as 192.168.1.1 where the first three numbers i.e. 192.168.1 indicates the network ID and the fourth number indicates the host ID.
There was rapid exhaustion of IPv4 as the number of devices connected to the internet was huge. So, the Internet Engineering Task Force(IETF) came up with a newer and faster version i.e IPv6.
Find the IP address in Kali
Let’s now look at how we can find the IP address using Kali Linux. We’ll use the IP addr command
Using the IP command
IP command is used to show or manipulate the routing, network devices, and interfaces. The ip addr command displays addresses, adds new addresses, and deletes the old addresses.
To find the IP address using the ip addr command, Execute the following command in a terminal window:
ip addr show
ip a
The ip a command and ip addr show command gives the same output.
To list the IP address of an individual network, Execute the following command:
ip addr show dev wlan0
To list only the IPv4 addresses for an individual network, Execute the following command:
ip -4 addr show dev wlan0
To list only the IPv6 addresses for an individual network, execute the following command:
ip -6 addr show dev wlan0
Using ifconfig command
The ifconfig command is used to configure a network interface. It is short for interface configuration. It can display the current network interface information, IP addresses, enable or disable the network interfaces, and much more. Other than the command line, It is also used in the system configuration scripts. To display the IP address using the ifconfig command, execute the following command in a terminal window:
ifconfig
It will display all the details of active interfaces and even check the IP addresses of servers. To list the details of all the interfaces i.e. both active and inactive interfaces, use the -a parameter along with the ifconfig command as shown below.
ifconfig -a
Here, the network interface wlan0 is not running. But, using the -a parameter will show the interface details.
To list the details of a specific network interface just add the interface name with the ifconfig command.
ifconfig wlan0
Using hostname command
hostname command is used to obtain the DNS name and to show and set the system’s hostname. But, It can also be used to obtain the IP address of the host i.e. of the system. To find the IP address using the hostname command, use the -i parameter by executing the following command:
hostname -i
This command will only show the system’s IP address. To display all the IP addresses of the host, use the -I parameter,
hostname -I
Using the GUI
You can also obtain information such as IP address, MAC address, broadcast address, primary DNS, and the Default route for both versions using the Network settings.
To find the IP address, Right-click on the network icon located at the top-right corner of the screen. Click on Connection Information from the options.
That’s all, all the information will be displayed including the IP address.
Conclusion
So, we discussed different ways of finding the IP address in Kali Linux. You can use any of the above commands as well as GUI to obtain the IP address. Thank you for reading!