Wednesday, 21 December 2011

configure static ipv4 in linux

Edit "/etc/sysconfig/network-scripts/ifcfg-eth0"  file  with required broadcast, gateway, ipaddress and network information as follows:

DEVICE=eth0
BOOTPROTO=none
BROADCAST=172.18.1.255
IPADDR=172.18.1.180
NETMASK=255.255.255.0
NETWORK=172.18.1.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
GATEWAY=172.18.1.1

Then, restart the interface eth0.

ifdown eth0
ifup eth0

your ipaddress is configured.

No comments:

Post a Comment

Tweets by @sriramperumalla