Adding an IP address to Debian/Ubuntu Linux
# sudo vi /etc/network/interfaces
Your original will look something like this:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0
Add the following below it to add another address to the same interface:
auto eth0:1
iface eth0:1 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0
Exit.
# sudo /etc/init.d/networking restart
Ping the interface and check to see if the IP is up
# sudo vi /etc/network/interfaces
Your original will look something like this:
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0
Add the following below it to add another address to the same interface:
auto eth0:1
iface eth0:1 inet static
address XXX.XXX.XXX.XXX
netmask 255.255.255.255
broadcast 0.0.0.0
Exit.
# sudo /etc/init.d/networking restart
Ping the interface and check to see if the IP is up
No comments:
Post a Comment