All the things You Have to Know About IP Addresses on Ubuntu

Not sure how to find your system's IP address in Ubuntu? No problem. In this guide, we've covered everything that has to do with IP addresses in Ubuntu for you. In addition to learning IP addresses, we'll also cover how to find your system's IP address, as well as a guide on how to set a static IP address in Ubuntu.

So let's get started.

What is an IP address?

This article uses some terminology including words like IP address, static IP address, dynamic IP address, IPv4, IPv6, etc.

And it is important that you understand what these terms mean so that you know what you are actually doing, rather than just following random instructions. Don't worry, you don't have to remember anything. You can just scroll back here if you feel like you don't know exactly what is going on.

If you are already familiar with these terms, don't worry. You can just skip to the next section. But let's start with the IP address first.

An IP address is a unique number that identifies your computer on the Internet. Think of it as your home address. Just as people can reach you by knowing your home address, other devices on a network can send and receive information to your system using an IP address.

Types of IP addresses

There are currently two types of IP addresses in use: IPv4 and IPv6.

IPv4, short for Internet Protocol Version 4, is the technology that connects your devices to the Internet. A 32-bit address is used, which consists of the numbers 0 to 256 separated by 0 Period ((.) Character. For example, the IP address for MUO is 54.157.137.27. Other devices and networks recognize MUO via this address.

IPv6, on the other hand, is a recent improvement over the IPv4 address. While IPv4 uses a 32-bit address, IPv6 has a 128-bit address space so that 340 undecillion unique IP addresses can be generated. IPv6 was introduced to save us from the lack of unique IPs as the number of devices connected to the Internet increases day by day.

There is another way to categorize IP addresses, i. H. On the basis of whether that is the case Static or Dynamic.

If you have a static IP address, it means that your device's IP address will always be the same. In other words, every time you connect to the internet, your IP address is the same as it was in your previous session. For example, if your IP address was 25.124.172.12 yesterday, it's the same today.

However, if your IP address is set to Dynamic, it can change. Dynamic Host Configuration Protocol (DHCP) servers are responsible for assigning dynamic IP addresses. Most devices on the internet – and most likely yours too – use dynamic IP as it is the cheapest option.

Find the IP address in Ubuntu using the command line

Now that we know the basic terms for IP addressing, let's look at how to actually find your IP address in Ubuntu. There are basically two ways to do the same thing. The first uses the Ubuntu command line.

To find your IP address in Ubuntu, enter this simple command into your terminal:

ip a

This will show you your assigned IP address. The MAC address is also displayed.

Note: The MAC address is a unique identifier that the manufacturer assigns to the network hardware. It basically helps your device stand out from all other devices on a network. And yes, it is different from the IP address.

Related Topics: Understanding the IP and MAC Address

Alternatively, you can also use the ip addr show Command. This command also shows the IPv4 and IPv6 addresses of your Ubuntu computer.

And that's it. Super easy right?

Find your IP address using the GUI

We totally understand when you're not on the command line; many people are not. However, we've come a long way from the beginnings of Linux when you just had to deal with the crappy text-based user interface to work with any of the Linux distributions.

Now most Linux distributions have a simple GUI that you can use to navigate and control the operating system. This means that you can still find your IP address in Ubuntu through a simple graphical interface, or in this case GNOME.

Related: What Is GNOME?

If you have a wired internet connection, please follow the steps below to continue:

  1. Open the settings from the Applications menu.

  2. Click on the left tab network. Finally choose the one the settings Symbol under the Wired Section.

Your IP address is now visible to you.

However, if you are using a wireless connection, choose the option Wireless Internet access Option from the left sidebar, and then click the settings Your network icon. A popup will appear on the screen with the IP address of your system.

How to set the static IP address in Ubuntu

Since most devices on the web are set to a dynamic IP address by default, most likely your device will also be set to a dynamic IP address. To configure it to a static IP address, you must first adjust your network settings.

To do this, you need to use Netplan, a tool for configuring networks on a Linux system. You can find the Netplan configuration files in the / etc / netplan Directory.

Open the YAML configuration file in the terminal with your preferred text editor. This manual uses nano.

sudo nano /etc/netplan/01-netcg.yaml

Now make the changes to your network interface name. Just copy and paste the following code into the configuration file to make your IP address static.

Network:
Version 2
Renderer: networkd
ethernets:
ens3:
dhcp4: no
Addresses:
– 192.168.121.199/24
gateway4: 192.168.121.1
Nameserver:
Addresses: (8.8.8.8, 1.1.1.1)

Note that you need to add the IP address that you want to use in the Addresses and Gateway4 Section.

Run the following command to save your file:

sudo netplan apply

Check the changes with the ip addr Command:

ip addr show dev ens3

Related Topics: What Are Configuration Files And How Can They Be Safely Edited?

Set the static IP address in Ubuntu via the GUI

If you're not a fan of the Linux command line, you can graphically set a static IP address in Ubuntu as well.

  1. Go to the settings Of your Ubuntu system.

  2. If you are using a wired connection, click network Button. Those who have a wireless connection choose the one Wireless Internet access Option from the list.

  3. Then click on Gear Icon next to your network connection.

  4. After you click it, a dialog box will appear. There select the IPv4 Tab to start setting up the static IP address.

  5. Now set the IPv4 method to Manual. Enter the Gateway, netmask, static IP, and DNSand then click on Apply.

Related: What is a DNA?

That's all about IP addresses in Ubuntu!

We have explained how to find out the IP address of your system through the terminal and a graphical user interface and how to add a static IP address. Hopefully this article has helped you learn all about IP addresses in Ubuntu. But don't stop now, there is a lot more to learn about IP addresses and networks in general.

Most devices connected to the Internet use the OSI model to communicate with one another. OSI or the Open Systems Interconnection Model is a global standard that forms the basis for data communication processes over the Internet.

What is the OSI model? The Open Systems Interconnection Model explained

How does your computer actually communicate with the internet?

Continue reading

About the author

Shaant Minhas
(20 articles published)

Shaant is a staff writer at MUO. A graduate in computer applications, his passion for writing explains complex things in plain English. When he's not researching or writing, he's enjoying a good book, running, or hanging out with friends.

More
From Shaant Minhas

Subscribe to our newsletter

Sign up for our newsletter to receive tech tips, reviews, free e-books, and exclusive offers!

One more step …!

Please confirm your email address in the email we just sent you.

Leave a Reply

Your email address will not be published. Required fields are marked *