The purpose of this tutorial is to show how to find the system IP address, public IP address, default gateway, and DNS servers on Ubuntu 22.04 Jammy Jellyfish. This can be done from both command line and GUI. We will cover the step by step instructions for both methods below.
In this tutorial you will learn:
- How to find local and public IP address
- How to check for default gateway
- How to display DNS server IP address
- How to display MAC address
|Category||Requirements, Conventions or Software Version Used|
|System||Ubuntu 22.04 Jammy Jellyfish|
|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 my IP address on Ubuntu 22.04 step by step instructions
Find IP address from command line
First we will cover the instructions to get IP address and other network information from command line.
- Get started by opening a command line terminal and check for your internal IP address by executing the
$ ip a
Locate the requested network interface and check for assigned IP address. Additionally, the above command also reveals the network interface hardware address a.k.a 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:
$ resolvectl status | grep Current
- To display default gateway IP address run:
$ ip r
Check for internal network configuration from GUI
To check for the internal IP address, default gateway, MAC address and DNS server settings on Ubuntu 22.04 Jammy Jellyfish desktop first open
Settings and click on
Network menu and hit the gear wheel of the desired network interface.
In this tutorial, we saw how to get network information from command line and GUI on Ubuntu 22.04 Jammy Jellyfish Linux. Such information includes the IP address, MAC address, default gateway, and DNS server IP addresses that are configured for the system.