Friday, 8 May 2015

Ubuntu IP configuration

sudo vi /etc/network/interfaces

configure Automatic address for a specific network card


# The primary network interface use DHCP to find our address
auto eth0
iface eth0 inet dhcp

configure Static IP address for your network card

#The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.7
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

 configure the  preffered DNS

sudo vi /etc/resolv.conf

nameserver 192.168.1.10

sudo /etc/init.d/networking restart

 setup secondary IP address or virtual IP address in Ubuntu

sudo vi /etc/network/interfaces

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x



sudo /etc/init.d/networking restart

No comments:

Post a Comment