Old IP addresses in routing table

Issues related to configuring your network
Post Reply
CaptShmim
Posts: 4
Joined: 2021/01/30 00:54:58

Old IP addresses in routing table

Post by CaptShmim » 2021/01/30 01:11:46

Hello,

Running 7.7.1908, Network Manager is disabled on startup and network service is active. 4 network ports

So I'm trying to setup networking on a machine that's in the field. I have someone edit the ifcfg scripts to change the IP Address to be the one provided by IT. When we restart the network, in the kernel routing table I see the old address and newly added address both bound to the same port. Every time we change something in the ifcfg script and restart the network on this machine is adds the new cofiguration and keeps the old in the routing table. I set a new GATEWAY in one of the scripts but the routing table still shows the old gateway as the default.

I have had the tech edit all the config file scripts to have
DEFROUTE=no
NM_CONTROLLED=no

except one file (enp7s0f1) which is the only one with these entries.
GATEWAY=xx.xx.xx.xx
DNS1=xx.xx.xx.xx
DEFROUTE=yes

Is there something else that persists the network configuration? I checked /etc/sysconfig/network and it's empty.

BTW I have the same computer at my desk that's in the field and when I edit my ifcfg scripts and restart the network my kernel routing table is correct, only showing the new addresses I have configured. Both machines were setup the same as they both come from a gold disc image I created.

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: Old IP addresses in routing table

Post by Whoever » 2021/01/30 18:27:58

Are you sure your tech is actually restarting the network and that he or she isn't just starting the network each time?

CaptShmim
Posts: 4
Joined: 2021/01/30 00:54:58

Re: Old IP addresses in routing table

Post by CaptShmim » 2021/02/01 15:55:49

Most times they are rebooting the machine to restart networking.

We started doing systemctl restart network just to save time, but both cases give the same issue.

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Old IP addresses in routing table

Post by TrevorH » 2021/02/01 16:02:54

If you're using NetworkManager then you should use NetworkManager not network.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CaptShmim
Posts: 4
Joined: 2021/01/30 00:54:58

Re: Old IP addresses in routing table

Post by CaptShmim » 2021/02/01 16:06:04

We're not using the NetworkManager. That service is disabled and I can verify this by reviewing the messages files. We're using the network service.

CaptShmim
Posts: 4
Joined: 2021/01/30 00:54:58

Re: Old IP addresses in routing table

Post by CaptShmim » 2021/02/08 19:55:32

Issue has been resolved.

Turns out tech in the field was making backup copies of the networking scripts by appending .bak to the file name (like ifcfg-enp8s0.bak) and the backups were stored in /etc/sysconfig/network-scripts. We're using the network service and when this service starts it goes to /etc/sysconfig/network-scripts and grabs everything that matches ifcfg-* minus the loopback. After reviewing the message log file, and some testing locally, I can see that a network interface is being configured for each backup file found in the network-scripts directory. Once we removed the backup files from the directory and restarted networking, all worked as expected.

Post Reply