Ubuntu: How to check if network configuration files work as expected?

After base Ubuntu installation, you have to configure the network interface file to get the network settings via DHCP/static IP address (if you haven’t configured during the initial installation). For this you need to edit /etc/network/interfaces file

$ vi /etc/network/interfaces

Now give the appropriate settings for interface card

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.50
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

$ /etc/init.d/networking restart

Now edit the hosts file
$ vi /etc/hosts

127.0.0.1 localhost
192.168.1.50 kurinchilamp.kurinchilion.com kurinchilamp

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

$ echo kurinchilamp > /etc/hostname
$ /etc/init.d/hostname.sh start

Ensure to do an update before carrying on other activities
$ apt-get update
$ apt-get upgrade

At this stage, if you need you can upgrade vi editor

$ apt-get install vim-full

Check the sources.list file
$ cat /etc/apt/sources.list

This is the file where the source files will be specified for package downloads when you issue the command apt-get

Run the following commands to ensure that the network produces identical result sets.
hostname
hostname -f

After the network configuration ensure that you are able to connect to the local network.

If have installed openSSH, you should be able to SSH from a remote location

$ ssh <yourlocalserver> should work

$ ping -c 4 localhost

$ ping -c 4 192.168.1.1 (gateway)

Then try pinging an external client to ensure that you are able to communicate with external world

$ ping -c 4 yahoo.com (external IP)

References:

  • http://www.howtoforge.com/perfect-server-ubuntu8.04-lts
  • http://www.ubuntugeek.com/ubuntu-804-hardy-heron-lamp-server-setup.html
Share

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *