[Linux] IP alias does not disappear

When I tried to change the original IP address to another one, both of them were given and it didn't disappear even after rebooting. The OS is CentOS 7.

・ Take a backup

cd /etc/sysconfig/network-scripts
cp -p ifcfg-eth0 ifcfg-eth0_20180413

Suppose you backed up with.
・ Change the IP address

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


DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=06:f5:9f:63:ec:b0
IPADDR=10.132.142.40
NETMASK=255.255.255.192

ʻChanged the part of IPADDR`.
・ Reboot and reflect

systemctl restart network

·result
#ip a

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 06:f5:9f:63:ec:b0 brd ff:ff:ff:ff:ff:ff
<font color="Red">inet 10.132.142.40/26 brd 10.132.142.63 scope global eth0</font>
valid_lft forever preferred_lft forever
<font color="Red">inet 10.132.84.6/26 brd 10.132.84.63 scope global eth0</font>
valid_lft forever preferred_lft forever

?? ?? ?? ?? ?? ?? ?? why? ?? ?? ?? ?? ?? ?? ?? It doesn't change even if it restarts. ..
Upon examination, it was apparently due to the name of the backup. If ofifcfg-eth0_yyyymmdd will read up to that point, so yyyymmdd_ifcfg-eth0 </ font> seems to be okay.
-Rename backup file

mv ifcfg-eth0_20180413 20180413_ifcfg-eth0

・ NW restart
systemctl restart network

·Verification
ip a

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 06:f5:9f:63:ec:b0 brd ff:ff:ff:ff:ff:ff
inet 10.132.142.40/26 brd 10.132.142.63 scope global eth0
valid_lft forever preferred_lft forever

It has disappeared. Alright, then the correct answer is not to make a backup! !! !! !! (Wrong)
that's all

Recommended Posts

[Linux] IP alias does not disappear
Solution when Linux does not recognize the built-in camera
Python version does not switch
Solution when background-cover of Linux version VS Code does not work