Jump to content


* * * * * 1 votes

Add multiple / dedicated ip's on Ubuntu


  • Please log in to reply
No replies to this topic

#1 Pirate Tony

Pirate Tony

    Advanced Member

  • Members
  • PipPipPip
  • 291 posts

Posted 09 July 2016 - 10:18 PM

Hello :)
 
Recently i got a message from a member here in e-worldhosting how he can add multiple ip's to his Ubuntu server. The steps are the below, make sure you copy before the files and have VNC if something goes wrong.

nano /etc/network/interfaces

 
You will see something like this :

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address xx.xx.xx.xx
netmask xx.xx.xx.xx
gateway xx.xx.xx.xx
dns-nameservers xx.xx.xx.xx xx.xx.xx.x

Let say we have this two ip's to add 1.1.1.1 & 2.2.2.2

 

We add this to our file :

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address xx.xx.xx.xx
netmask xx.xx.xx.xx
gateway xx.xx.xx.xx
dns-nameservers xx.xx.xx.xx xx.xx.xx.x

auto eth0:0
iface eth0:0 inet static
  address 1.1.1.1
  netmask xx.xx.xx.xxauto eth0:1
iface eth0:0 inet static
  address 2.2.2.2
  netmask xx.xx.xx.xx

To bring up eth0:0 and eth0:1 run via SSH :

sudo ifup eth0:0
sudo ifup eth0:1

To bring down eth0:0 and eth0:1 down :

sudo ifdown eth0:0
sudo ifdown eth0:1

That's all. :)






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users