Knowledgebase - Binding multiple IPs to one interface in Debian/Ubuntu

Our Client Portal

Portal Home > Knowledgebase > Dedicated Servers > Binding multiple IPs to one interface in Debian/Ubuntu

Binding multiple IPs to one interface in Debian/Ubuntu

Important Notes:

1.) Before making any changes to your network configuration, please make sure you obtain any relevant information such as Gateway, Subnet and allocated IP Block details to ensure no mistakes are made!
2.) Make a backup of your existing configuration in case you need to fall back to this at a later stage: sudo cp /etc/network/interfaces /etc/network/interfaces_backup


Now edit it’s time to edit your configuration: sudo vi /etc/network/interfaces

We’re only interested in updating the “eth” part of the configuration so ignore the loopback section if present.

Rearrange your existing configuration to look as follows (feel free to remove the broadcast and network entries):

auto eth0

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254


Now add your new entries so the finish configuration looks like:

auto eth0
auto eth0:0
auto eth0:1

iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254

iface eth0:0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254

iface eth0:1 inet static
address 192.168.1.3
netmask 255.255.255.0
gateway 192.168.1.254


You should be able to see a pattern emerging, keep adding new entries as necessary!

Once you have finished adding your IPs you can save and close the file and finally, for the new changes to take effect, issue: /etc/init.d/networking restart

Add to Favourites Add to Favourites

Was this answer helpful?

Print this Article Print this Article

Also Read
IP and DNS information (Views: 13078)
IP and DNS information (Views: 13078)

Recent News
Knowledgebase Articles
It is now possible to temporarily suspend the monitoring of Managed Dedicated Se...
Please Note: In order to reset your Centos password you will need KVM access to ...
As of Java version 7 onwards, the Java development team continue to make securit...
Live Chat

Need a helping hand?

We've got a lot of solutions to choose from so why not let one of our experts help!

Live Chat

Find this popup annoying?

If so, we're very sorry! You can prevent further invitations by selecting "YES" below