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 forever2: 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:
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-
How to Open Ports in Windows?
313 2
-
How to Grant Windows Administrator Privileges?
228 0
-
How to install Webmin on Ubuntu?
881 2
-
Linux SSH Terminal Commands and Explanations
797 3
-
CentOS Stream 10 Update Commands
855 1
-
CentOS Stream 9 Update Commands
1248 2
-
CentOS Stream 8 Update Commands
675 0
-
What is FreeBSD?
857 2
-
Out: 452 4.3.1 Insufficient system storage
768 2
-
Turning Off Automatic Updates in Windows Operating Systems
879 0