Search This Blog

Monday, 15 August 2016

HOW TO SET IP ADDRESS IN UBUNTU 14.04

HOW TO SET IP ADDRESS IN UBUNTU 14.04

To set ip address in ubuntu using terminal we have to do three things.
  1. 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.
  2. 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.
  3. Modify network interfaces to be used goto location /etc/network/ edit give details in file interfaces. Use the following command
  4. 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
  5. 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.
  6. You can also make network interface up and down using command,
     sudo ifconfig eth0 down
     sudo ifconfig eth0 up
  7. To check gateway use the command ip route show
  8. To find netmask / subnet use the command ifconfig <iface> | grep mask
  9. 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

Linux Partitioning Disk & Formatting commands

Linux Partitioning Disk & Formatting commands fdisk man fdisk pi@rasberrypi ~$ sudo fdisk -l