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

    From Greg Wooledge@21:1/5 to Steffen Dettmer on Tue Mar 26 19:10:01 2024
    On Tue, Mar 26, 2024 at 06:33:42PM +0100, Steffen Dettmer wrote:
    I changed a gateway on a remote site using /etc/network/interfaces by changing gateway. However, at reboot some old gateway IP reappears.

    So then the question is *which* of the many different subsystems is in
    use to set the system's default gateway. It might be coming from /e/n/i
    or from NetworkManager or from systemd-networkd or others.

    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

    See, that's not useful. That's not how this file is structured. It's
    NOT just a series of independent lines.

    We would need to see the entire /e/n/i file to know which interface
    that gateway definition is associated with, and so on.

    A gateway definition on an interface that isn't managed by /e/n/i (ifupdown) will do nothing at all. For example, you might have an eno1 definition
    which includes a gateway line, but which does *not* have an "auto eno1"
    line to activate it -- in which case the interface might be managed by NetworkManager instead, or something else.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Henning Follmann@21:1/5 to Steffen Dettmer on Tue Mar 26 20:10:01 2024
    On Tue, Mar 26, 2024 at 06:33:42PM +0100, Steffen Dettmer wrote:
    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


    [...] deleted that nonsense.

    Hello,
    why are you making it so difficult to anyone trying to help you?
    Nobody is interested in your way how you edit that file.

    please show us two versions of that file (pre reboot and after)
    Also tell us any programs you use to manage your network settings

    [] NetworkManager
    [] systemd-networkd
    [] some magic own scripts
    [] ...

    -H


    --
    Henning Follmann | hfollmann@itcfollmann.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pierre-Elliott =?utf-8?Q?B=C3=A9cue@21:1/5 to Steffen Dettmer on Tue Mar 26 19:20:02 2024
    As it's a PVE kernel I guess you rely on Proxmox.

    *Theoretically*, Proxmox VE uses /etc/network/interfaces.new to apply
    its config and potential manual changes made by an administrator
    (changes that should be applied afterwards via ifreload).

    I'd wonder whether this mechanism is not the cause if your troubles.
    --
    PEB

    Steffen Dettmer <steffen.dettmer@gmail.com> wrote on 26/03/2024 at 18:33:42+0100:
    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
  • From Andy Smith@21:1/5 to Steffen Dettmer on Tue Mar 26 20:30:01 2024
    Hello,

    On Tue, Mar 26, 2024 at 06:33:42PM +0100, Steffen Dettmer wrote:
    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.

    Is this actually Debian?

    I have vague memories of someone else asking something like this
    before, and at the time I wasn't aware of any software packaged in
    Debian that alters the user's /etc/network/interfaces file. I think
    in that case it turned out to not actually be Debian.

    I also think that there is some Debian packaging rule about one
    package not altering the config file of another package unless by
    co-operation between the maintainers, so if this does actually turn
    out to be Debian there might be bugs to report.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)