Leading zeros in IPv4 address causes system assign different IP
Issue
- Leading zeros in IPv4 address causes system assign different IP.
- When setting the IPADDR in ifcfg file, adding 0 to the front of the last octet of the IP address by mistake, then if restart the network system will assign a different IP, why?
# egrep 'IPADDR|PREFIX' /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=xxx.xxx.xxx.066
PREFIX=24
# service network restart
# ip a | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
inet xxx.xxx.xxx.54/24 brd xxx.xxx.xxx.255 scope global eth0
Environment
- Red Hat Enterprise Linux 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.