Monday, June 28, 2010

Adding an IP address to Debian/Ubuntu Linux

SkyHi @ Monday, June 28, 2010
[root@deb01 network]# pwd
/etc/network

[root@deb01 network]# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
        address 192.168.100.240
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255
        gateway 192.168.100.2
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.100.3
        dns-search deb01.linu.internal
auto eth0:1
iface eth0:1 inet static
        address 192.168.100.241
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255

auto eth0:2
iface eth0:2 inet static
        address 192.168.100.242
        netmask 255.255.255.0
        network 192.168.100.0
        broadcast 192.168.100.255


# /etc/init.d/networking restart

REFERENCES
http://www.debian-administration.org/article/An_introduction_to_Debian_networking_setup
http://serverfault.com/questions/66901/adding-a-second-ip-to-debian-server