[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

debian12: something destroys /etc/network/interfaces at boot



Hi,

I changed a gateway on a remote site using /etc/network/interfaces by
changing gateway. However, at reboot some old gateway IP reappears. I
really hate when some magic knows better than an explicitly set value.
What happens here? How can I get rid of this? It is 100% reproducible.

I have no clue where the wrong 2.43 comes from.

Any hints appreciated!

Steffen


root@site4-nas:~# ls -l /etc/network/interfaces
-rw-r--r-- 1 root root 117 Mar 26 18:19 /etc/network/interfaces
root@site4-nas:~# grep gateway /etc/network/interfaces
        gateway 192.168.2.43
root@site4-nas:~# perl -npi -e 's/gateway 192.168.2.43/gateway
192.168.2.1/' /etc/network/interface
                                        s
root@site4-nas:~# grep gateway /etc/network/interfaces
                                                    gateway 192.168.2.1
root@site4-nas:~# ls -l /etc/network/interfaces
-rw-r--r-- 1 root root 116 Mar 26 18:21 /etc/network/interfaces
root@site4-nas:~# sync
root@site4-nas:~# date; sleep 1m; date
Tue Mar 26 06:21:47 PM CET 2024
Tue Mar 26 06:22:47 PM CET 2024
root@site4-nas:~# ls -l /etc/network/interfaces
-rw-r--r-- 1 root root 116 Mar 26 18:21 /etc/network/interfaces

OK, so gateway is correct in 18:21 timestamped user config file. Lets reboot.

root@site4-nas:~# reboot
root@site4-nas:~# Connection to site4-nas closed by remote host.
Connection to site4-nas closed.
root@site4-pve:~# ssh site4-nas
Linux site4-nas 6.5.11-8-pve #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8
(2024-01-30T12:27Z) x86_64...
Last login: Tue Mar 26 18:20:50 2024 from 192.168.2.28
root@site4-nas:~# ls -l /etc/network/interfaces
-rw-r--r-- 1 root root 117 Mar 26 18:23 /etc/network/interfaces
root@site4-nas:~# grep gateway /etc/network/interfaces
        gateway 192.168.2.43

root@site4-nas:~# find /etc /lib/systemd/ /var/lib/ -type f -print0 |
xargs --null grep 192.168.2.43
/etc/network/interfaces:        gateway 192.168.2.43

user config file has updated timestamp and contains bougous gateway.

Help please!


Reply to: