Configuring Multiple IP Addresses for Ubuntu Linux
There are times when you may want to add a second or multiple IP addresses to your linux system. It’s fairly straightforward to add a sub-interface to your current configuration. In fact, it’s just as easy to add ten sub-interfaces as it is one.
Start by opening a console with root permissions.
Next we edit the interfaces configuration file.
# nano /etc/network/interfaces
Within the interfaces file, you should see a section that contains IP information for your current network interface cards.
My primary interface in this example is “eth0″. If I want to add another ip address to that interface I would start by defining it. For example add a line like the following and modify it to match your setup.
auto eth0:1
Notice that it is named the same as my original “eth0″ but also has “:1″ appended to it.
Below that line add the following line. Again, modifying the interface name to match your configuration.
iface eth0:1 inet static
Next you need to add the IP addressing information. I’ve used the following.
address 172.17.2.10 netmask 255.255.0.0 network 172.17.0.0 broadcast 172.17.255.255 gateway 172.17.1.1
Press “ctrl-x” to exit nano editor. Press “y” to save modifications.
Accept the default save path.
Next, we need to restart the network service.
# /etc/init.d/networking restart
Be alert for any errors when restarting the network. This will indicate a possible typo in the configuration if you get an error.
Let’s view the new sub-interface we created.
# ifconfig eth0:1
All the settings seem to have taken effect…
Next we’ll ping the interface to test it.
# ping 172.17.2.10
Successful ping requests are always a good sign. At this point you may want to try to ping another IP address on the same subnet as your new interface. I’ll leave that part in your capable hands.
We’re all done here, so I’ll log off as root.
# exit

















Locke said,
Wrote on November 20, 2007 @ 9:50 am
Good walkthrough, straight to the point and effective. Keep up the good work and drop by my site sometime and let me know what you think!
video poker saloon said,
Wrote on February 28, 2008 @ 5:08 am
video poker saloon…
poodle foundling Erikson,…
internet gambling regulation said,
Wrote on July 27, 2008 @ 12:40 am
internet gambling regulation…
moonlight Foote,repudiation.carbonizing deals …
casino online casinò in linea said,
Wrote on August 6, 2008 @ 5:57 pm
casino online casinò in linea…
Doubleday.divisional nonterminating …
Ulf said,
Wrote on August 25, 2008 @ 3:22 pm
Thanks alot, really helped me out.
evil said,
Wrote on September 16, 2008 @ 10:51 pm
good info keep it up
new orleans las vegas casino barnum bailey circus said,
Wrote on September 21, 2008 @ 6:29 am
new orleans las vegas casino barnum bailey circus…
ARPA.retraction inflammation choreograph …
Justin said,
Wrote on October 2, 2008 @ 10:21 am
Fantastic walkthrough. Thanks
florida health insurance qotes said,
Wrote on October 4, 2008 @ 6:46 am
florida health insurance qotes…
presidential:chest feigning squadrons …
lincoln general acess auto insurance said,
Wrote on October 7, 2008 @ 8:40 pm
lincoln general acess auto insurance…
relocating.decay practice….