Monday, August 3, 2015

Set the static IP address to the server centos 6.




You can either use setup command or you can edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 to set up a static IP address. For setting up a static IP address you need

DEVICE=eth0 # the device name
TYPE=Ethernet #type of device
ONBOOT=yes # Set up  the IP on boot
BOOTPROTO=static #for setting up static IP
IPADDR=192.168.0.183 # ipaddress of the machine
NETMASK=255.255.255.0 #netmask of the ip
GATEWAY=192.168.0.1 #Default gateway

Then restart network
[root@server183 ~]# service network restart

Shutting down interface eth0:
[  OK  ]

Shutting down loopback interface:
[  OK  ]

Bringing up loopback interface:
[  OK  ]

Bringing up interface eth0:
[  OK  ]

[root@server183 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 68:F7:28:6F:A1:D8 
          inet addr:192.168.0.183  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::6af7:28ff:fe6f:a1d8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:724881 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4557213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:145109395 (138.3 MiB)  TX bytes:6301810927 (5.8 GiB)


No comments:

Post a Comment