Ubuntu Linux: Network configuration from command Line! Setting IP address, default gateways, and DNS servers for accessing Internet/network on a LAN.

Here is an easy sample for configuring Network Settings in Ubuntu Linux:

 Assumptions: You want to set IP address of your system as at eth0 interface (ethernet or LAN, RJ-45 Cable port), with default gateway as and DNS servers as and

  • To check existing network settings

$ ifconfig -a

  • Setting IP address and netmask:

    To activate network interface eth0 with IP address ( ) and netmask (

$ sudo ifconfig eth0 netmask 

Shutting down eth0:
sudo ifconfig eth0 down

         Bring up eth0:
sudo ifconfig eth0 up

  • To see the existing routing table

$ route –n

  • Setting default gateway(

$ sudo route add default gw

  • Setting DNS servers

Open the file: /etc/resolv.conf

$ sudo vi /etc/resolv.conf

Write DNS Servers:




ping technologydwell.com


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s