There are several ways to view your system’s IP address in Linux. In this tutorial, you will learn how to see your IP address from command line and GUI.
In case you want to check your system’s external IP address instead: Check External IP From Linux Command Line
Commands to View Internal IP Address
Method 1. Using the ip
command will show the IP address of all your network interfaces:
$ ip address
Or to shorten the command:
$ ip a
We have highlighted the IPv4 and IPv6 addresses in the output below:
Method 2. Using the hostname
command:
$ hostname -I | awk '{print $1}'
Method 3. Using the ip route
command will show you the IP address of the interface that is used for routing to an IP that you specify – in this case, 1.2.3.4
.
$ ip route get 1.2.3.4 | awk '{print $7}'
Method 4. For Linux systems that have Network Manager installed, you can use the nmcli
command:
$ nmcli -p device show
Viewing Internal IP via GUI
You can also view your IP address by using the GUI in your system. Here are the instructions for GNOME:
Step 1. In your desktop, locate and open the network icon in the top right of your screen. Then click on Wired or Wireless Settings.
Step 2. In the Network tab, click on the gear icon to show all the details for that network interface.
Step 3. This window will reveal your IPv4 and IPv6 address.