Advance

How to add a second IP to Ubuntu

How to add a second IP to Ubuntu
1
(2)

It is very usual for network users, need to add multiple IPs to the operating system’s network card. So you would learn How to add a second IP to Ubuntu today. Previously we said about set IP static on Ubuntu, and in this tutorial, we will review and teach the desired Linux commands. Adding a second IP to Ubuntu requires entering several commands.

 

How to add a second IP to Ubuntu

You can add a second IP to Ubuntu in two ways.

1– Temporary

2– Permanent

How to add a second temporary IP

1– Enter your Linux Ubuntu terminal environment.
2. Enter the following command to add the second IP.

sudo ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 up

In the above example, you should add the address 192.168.1.2 to Ubuntu as the second IP.

Note: The above IP command is valid until the foot system is rebooted and will be removed after the operating system reboots.

Do you need your own Ubuntu VPS? Join us here

Recommended Article: How to install WordPress with Apache in Ubuntu 20.04

How to add a second permanent IP

1– Enter your Linux Ubuntu terminal environment.

2– Open /etc/network/interfaces file with an editor.

nano /etc/network/interfaces

3– Enter the following phrase at the end of the opened file.

auto eth0:0  iface eth0:0 inet static  address 192.168.1.2 network 192.168.1.0  netmask 255.255.255.0

Instead of the written IP address, enter your desired IP.

Note: The key point in this section is to add the eth0:0 option, which must be followed, and the rest of the lines are like setting the first IP.

4– Save the file and exit.

5– Turn off / on the added virtual card once, with the following commands.

ifdown eth0:0 ifup eth 0:0

In this section, the additional IP  is completed. Watch to not lose our future related articles.

 

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 2

No votes so far! Be the first to rate this post.

View More Posts
Tom Veitch
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

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

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day