The purpose of this tutorial is to show how to find the local IP address, public IP address, default gateway, and DNS servers on a Kali Linux system.
It is possible on Kali to get IP address information from command line or from GUI. We will cover the step by step instructions for both methods below.
In this tutorial you will learn:
- What is the difference between local and public IP?
- How to find local IP address via command line and GUI
- How to find public IP address
- How to display default gateway information
- How to display DNS server IP address
- How to display MAC address
|Category||Requirements, Conventions or Software Version Used|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to find IP address in Kali Linux step by step instructions
Check out the sections below to learn the difference between public IP and local IP on Kali Linux. You will also learn all the commands and GUI steps needed to view various network information on your system.
What is the difference between local and public IP?
If your system is connected to the internet, you are most likely using at least two IP addresses on your system. One IP address is your system’s local address, which is used to communicate with other devices on your home network. This includes your router and any devices you have connected to it.
Your public IP address is the one that devices over the internet will see you connecting from. This is an IP address that is routable on the world wide web, and will grant you connectivity to other servers and routers around the world. Typically, a home network has one public IP address, which is shared by every device that is connected to your router. Of course, other types of networking scenarios exist, but this is the most common.
Check IP address information on Kali Linux
- To see your local IP address, you can run the following command in terminal:
$ ip a
Locate the requested network interface and check for the assigned IP address. Additionally, the above command also reveals the network interface hardware address (also known as the MAC address).
- There are also various ways to get your public IP address. You can go to a website like ip chicken or execute one of the following commands in terminal:
# echo $(wget -qO - https://api.ipify.org) OR # echo $(curl -s https://api.ipify.org)
- To check for currently used DNS server IP address, execute this command:
$ systemd-resolve --status | grep Current
- To display default gateway IP address, run this command:
$ ip r
- You can also check for this information from your desktop GUI. To check for the internal IP address, default gateway, MAC address and DNS server settings on Kali Linux desktop first right click on the network icon in the upper right corner and then click on
Connection informationmenu and click the name of the desired network interface.
In this tutorial, we saw how to get network information from command line and GUI on Kali Linux. Such information includes the local IP address, public IP address, MAC address, default gateway, and DNS server IP addresses that are configured for the system.