Leading zeros in IPv4 address causes system assign different IP

Solution Verified - Updated -

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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content