September 28, 2007

Troubleshooting concepts: Linux: Setting up a static IPAddress

System to configure static networking rather than Dynamic IPAddress
Before going to set static addressing , Please note down the following things in your network

1. IP Address of the machine
2. NETMASK and GATEWAY
3. Routing ( Default via 192.168.1.x dev eth0)
4. nameserver in the /etc/resolv.conf

  1. search domain.com
  2. nameserver 192.168.1.x
Bring down your network .....with ifdown eth0
Change the contents of /etc/sysconfig/network-scripts/ifcfg-eth0


Device=eth0
BOOTPROTO=None #( Don’t forget to change it from dhcp to none)
ONBOOT=yes

#Add IPAddress here :
IPADDR=192.168.1.x
#Add NETMASK
NETMASK=255.255.255.0
#Add GATEWAY
GATEWAY: 192.168.1.x

Make sure that your hostname is correct.
Open your /etc/sysconfig/network and check your hostname
HOSTNAME=Example

Verify that hostname can be resolved with out using DNS
127.0.0.1 localhost.localdomain localhost
192.168.1.2 example example.example.com

Bring up eth0 ...............ping machine...............it works ...!
Restart your machine with : shutdown -r now
ping machine.........it works...!

No comments: