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 10.1.1.8 at eth0 interface (ethernet or LAN, RJ-45 Cable port), with default gateway as 10.1.1.1 and DNS servers as 208.67.220.220 and 208.67.222.222.

  • To check existing network settings

$ ifconfig -a

  • Setting IP address and netmask:

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

$ sudo ifconfig eth0 10.1.1.8 netmask 255.255.255.0 

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(10.1.1.1)

$ sudo route add default gw 10.1.1.1

  • Setting DNS servers

Open the file: /etc/resolv.conf

$ sudo vi /etc/resolv.conf

Write DNS Servers:

nameserver 208.67.220.220

nameserver 208.67.222.222

Test:

ping technologydwell.com

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s