update redhat dynamic IP to static IP

step1: add gateway
     vi /etc/sysconfig/network
     add below "GATEWAY" line
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1


step2: add your new IP address
      update dhcp to static,
      add your ipaddr line
      add your netmast line

DEVICE=eth0
#BOOTPROTO=dhcp
BOOTPROTO=static
HWADDR=00:CC:23:3A:C3:EF
IPADDR=192.168.1.200
NETMAST=255.255.255.0

ONBOOT=yes


step3: update name server
vi /etc/resolv.conf
nameserver x.y.z.p
(normal, below step won't need, cause it will automaticlly get your name server)

step4:verify the static ip config effect:
ifconfig eth0

猜你喜欢

转载自coderanch.iteye.com/blog/1772730
IP
今日推荐