X
X

Select Your Currency

Türk Lirası $ US Dollar
X
X

Select Your Currency

Türk Lirası $ US Dollar
Yıllık Satın Alımlarda %15 İndirim: Şimdi Tasarruf Edin! Detaylı Bilgi İçin Tıklayın!

Knowledge Base

HomepageKnowledge BaseUbuntu How to Add Additional IP Address i...

How to Add Additional IP Address in Ubuntu 22?

Step 1: Find the Network Interface Name

Open the terminal and run the following command to see the existing network interfaces:

ip a

When you run this command, you'll get an output similar to the following:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 08:00:27:00:4c:53 brd ff:ff:ff:ff:ff:ff inet 192.168.1.5/24 brd 192.168.1.255 scope global dynamic noprefixroute enp0s3 valid_lft 86386sec preferred_lft 86386sec inet6 fe80::a00:27ff:fe00:4c53/64 scope link noprefixroute valid_lft forever preferred_lft forever

In this output, the network interface name is enp0s3 and the current IP address is 192.168.1.5/24. Your system's network interface name might be different, such as eth0 or ens192.

Step 2: Create and Edit the Netplan Configuration File

First, create or edit a netplan configuration file. For example, create or edit the 01-netcfg.yaml file:

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

Paste the following content into the file and adjust it according to your network interface name and IP addresses. In this example, we assume the network interface name is enp0s3:

network:

  version: 2

  renderer: networkd

  ethernets:

    enp0s3:

         dhcp4: true

         addresses: [192.168.1.10/24, 10.0.0.10/24]

Step 3: Apply the Configuration

Save and exit the file, then apply the configuration with the following command:

sudo netplan apply

Click to review Ubuntu virtual server packages!

Can't find the information you're looking for?

You have examined the knowledge base in detail, but if you cannot find the information you need,

Create a Support Ticket
Did you find it useful?
(400 times viewed. / 1 people found helpful.)