In this tutorial, we discuss how to obtain the IP and MAC addresses in Ubuntu, two important components in networking, both through the graphical environment and the command line.
We encounter components such as IP and MAC addresses in all devices connected to the network, including laptops, computers, mobile phones, tablets, and other gadgets. These are unique to each device and specific to that device. Related Articles: How to find a MAC address in Kali Linux?
Obtaining the IP and MAC addresses
You will most likely need this information. Below, we will explain how to find information related to IP and MAC addresses in the GNU/Linux Ubuntu operating system. This tutorial will only focus on a device’s unique IP address. While the definition of IP in a router, in general, and on the internet page, is different and you have to use a different method to obtain it, which is not included in this tutorial.
You can also refer to the article “Tutorial on Changing MAC Address in Ubuntu” to find out how to change the MAC address.
Method 1: Ubuntu
This information is easily accessible in the Status or notification sections in new Linux operating systems. Click on the network icon and then select Connection Information. The IP address and other related information are located in this section. The hardware address is the same as the MAC address. This system and many modern Linux distributions use Network Manager.
Method 2: Command Line
If you only have access to the terminal, run the following command:
ifconfig
In the above output, eth0 is your network connection that has the necessary information.
Method 3: for displaying the MAC address in Ubuntu
To view the IP Address in the Linux Ubuntu operating system, you can refer to the above link, which shares commands common to many Linux distributions.
However, in addition to viewing the IP in the command below, you will actually see the MAC Address related to each of your network cards.
ip addr
The list of network cards as well as the addresses and other settings for each of them, are displayed in the command output. Now you just need to specify the name of your desired network card in the command below, and the settings for that network card will be displayed:
ip addr show eth0
You should replace eth0 with the name of your desired network card.
As you can see, the MAC Address is also displayed along with other information.
Related Articles: