In this tutorial, we will learn how to get the information of our private and public IP addresses on Kali Linux via command line terminal and GUI.
Get Private or Local IP
Example 1. One of the main tools that we can use to display our local IP is the
ip command. This command also allows us to configure our network parameters.
$ ip addr show
Example 2. The command can also be shortened to:
$ ip a
Example 3. You can also retrieve IP information with the
hostname command, to check your system’s IP address.
$ hostname -I
Example 4. Another alternative is the
ifconfig command, which gives you the information of your current network.
Get Public or External IP
In order to get the public IP of our network, we can use the
curl commands, followed by a web server that we can use to send an HTTP request and allow us to get our public IP information. In these examples, we will use ifconfig.me.
Example 1. Using the
$ curl ifconfig.me
Example 2. Using the
$ wget -qO- ifconfig.me
Displaying IP via GUI
If you want to get your IP information via GUI, follow these very simple steps.
Step 1. In the right top corner of your screen, right-click on the network icon, and then select Connection Information.
Step 2. You will get a window with all the network information including IP, DNS, broadcast address, etc.