How to change ipv4 centos

edited August 2014 in Proposed How-Tos
Hello ! if you use Snapshots to built your server . you can change ip v4 for server working .
the first you need command :
vi /etc/udev/rules.d/70-persistent-net.rules :
look at this line
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:50:56:ae:00:1a",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:50:56:ae:00:1b",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

you need remove
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:50:56:ae:00:1a",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
an change
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:50:56:ae:00:1b",
ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

save it and remember your ATTR{address} is "00:50:56:ae:00:1b"

next vi /etc/sysconfig/network-scripts/ifcfg-eth0

edit old ,DNS1,GATEWAY,HWADDR,IPADDR
to new DNS1,GATEWAY,HWADDR,IPADDR

save it
and : service network restart

server woking !

Sign In or Register to comment.