Configuring your Linux
machine to run on a static IP is easy. You can do that both from Console and
GUI.
This tutorial is to configure a static ip in Linux using Console. Follow following steps :
a) Go
to
# cd
/etc/sysconfig/network-scripts/
Every network interface will have it’s own interface script files.
For Ex
- eth0,eth1,eth2 etc.
b) Edit ifcfg-eth1 interface script file for interface eth1.
Replace the contents of the ifcfg-eth1 file with the parameters below.
# vi ifcfg-eth1
DEVICE=eth1
IPADDR=xxx.xxx.xxx.xxx
NETMASK=255.255.255.0
NETWORK=xxx.xxx.xxx.0
# If you're having problems with gated making
xxx.xxx.xxx.0/8
# a martian, you can change this
to something else
# (255.255.255.255, for example)
BROADCAST=xxx.xxx.xxx.255
ONBOOT=yes
NAME=loopback
c) Save the file and restart your interface to apply changes.
# ifdown eth1
# ifup eth1
#
service network restart
d) That's it :)
Thanks!!!!!!! Enjoy
Programming :)
Comments
Post a Comment
Thanks for your valuable comments.