HOW TO SET IP ADDRESS IN UBUNTU 14.04
To set ip address in ubuntu using terminal we have to do three things.
- Disable graphical management of network connection edit file use the command sudo gedit /etc/NetworkManager/NetworkManager.conf . Do changes like comment out the line dns=dnsmasq using hash (#) sign. secondly change line which says managed=false to managed=true.
- Gather information about the static ip (interface, ip to be used , subnet-mask, gateway, DNS). Use the ifconfig -a command to check about the details.
- Modify network interfaces to be used goto location /etc/network/ edit give details in file interfaces. Use the following command
- sudo gedit /etc/network/interfaces write the following
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address x.x.x.x
netmask x.x.x.x
gateway x.x.x.x
dns-nameservers x.x.x.x - Restart ubuntu networking services using the following commands,
sudo service network-manager restart
sudo service networking restart
sudo service resolvconf restart
This will restart ubuntu network services. you can confirm given ip address using ifconfig command. - You can also make network interface up and down using command,
sudo ifconfig eth0 down
sudo ifconfig eth0 up - To check gateway use the command ip route show
- To find netmask / subnet use the command ifconfig <iface> | grep mask
- DNS is like and index used to resolve hostname to an ip address. Use google public DNS ip addresses 8.8.8.8 8.8.4.4 we can use our your router ip if it does dns lookup and gateway router ip address.
No comments:
Post a Comment