Wednesday, February 8, 2012

Network configuration in Ubuntu

Open the file /etc/network/interfaces in vi mode or in different editor

sudo vi /etc/network/interfaces

Do the following changes –

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.2.112
netmask 255.255.240.0
network 192.168.1.1
broadcast 192.168.1.1
gateway 192.168.1.1

Now open the resolv.conf to add DNS settings

sudo vi /etc/resolv.conf

Do the following changes ---

nameserver 192.168.2.112
search localdomain.com

You might need to remove dhcp-clinet3

sudo apt-get remove dhcp-client

Now restart the network

sudo /etc/init.d/networking restart

and also restart the network manager

sudo /etc/init.d/network-manager restart

Now ping www.google.com to check whether your connection is ready.



No comments:

Post a Comment