2009-04-05

Linux networking - edit /etc/network/interfaces for fixed IP assigment

This is a follow up of the previous post, which demonstrate how to configure NIC (Network Interface Card) to obtain IP address automatically using DHCP client. This post, however, attempt to demonstrate how to assign fixed IP assignment onto NIC, using CLI (Command Line Interface). The below is the instructions :

1. Edit /etc/network/interfaces using vim to include the following. :
<start of /etc/network/interfaces>
# make sure below line exist for interface to auto start when /etc/init.d/networking is initiate
auto l0 eth0
iface eth0 inet static
address 192.168.0.168
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
<end of /etc/network/interfaces>


2. Edit /etc/resolv.conf to include the below line to configure the DNS client for URL resolving :
nameserver 208.67.222.222


3. Restart the NIC to make the changes take effect by running the command "/etc/init.d/networking restart".

Voilla !!!

No comments: