Configure Static IP

To Configure Static IP address in RHEL 6:

[root@masterdns ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=”eth0″

#BOOTPROTO=”dhcp”

BOOTPROTO=STATIC

IPADDR=192.168.211.134

NETMASK=255.255.255.0

GATEWAY=192.168.211.2

HWADDR=”00:0C:29:69:A3:3C”

IPV6INIT=”yes”

NM_CONTROLLED=”yes”

ONBOOT=”yes”

 

[root@masterdns ~]# ifconfig

eth1      Link encap:Ethernet  HWaddr 00:0C:29:88:88:49

inet addr:192.168.211.134  Bcast:192.168.211.255  Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe88:8849/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:3920 errors:0 dropped:0 overruns:0 frame:0

TX packets:2418 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:3063216 (2.9 MiB)  TX bytes:254538 (248.5 KiB)

Interrupt:19 Base address:0x2024

 

lo        Link encap:Local Loopback

inet addr:127.0.0.1  Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING  MTU:16436  Metric:1

RX packets:548 errors:0 dropped:0 overruns:0 frame:0

TX packets:548 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:4381430 (4.1 MiB)  TX bytes:4381430 (4.1 MiB)

[root@masterdns ~]# hostname

masterdns.ostlocal.com