some party overrides my /etc/network/interfaces, is it to be expected?

Tony

Renowned Member
Nov 4, 2010
111
9
83
Hi,

I installed ifupdown2 on a pve node and after ifreload -a and reboot, it seems /etc/network/interfaces is re-generated, not sure by which party. Is it to be expected? The comments seem to come from PVE, however the wiki says Proxmox doesn't change /etc/network/interfaces. Any hint please?
 
Last edited:
Where does it say that? Of course it changes this file, how else should the underlying Debian configure the interfaces?
And yes, the comment about changing the file only when you know what you're doing, is put there by pve. ;)
 
Where does it say that?
https://pve.proxmox.com/wiki/Network_Configuration

Of course it changes this file, how else should the underlying Debian configure the interfaces?
And yes, the comment about changing the file only when you know what you're doing, is put there by pve. ;)
I know what I want to do with my /etc/network/interfaces. I didn't make any change to network config via GUI, so I am surprised that it overrode my /etc/network/interfaces
 
it says it does not write directly, but to a new file which then gets moved in on the next reboot (or, in case of ifupdown2, "apply network changes").. you (or some other admin on your node) must have queued such changes at some point before the reboot?
 
just to make this clear: PVE never changes the network config on its own - all network config changes are triggered by user actions. the actual effect might be delayed until the next reboot though (in which case you see "pending changes" in the GUI).
 
I repeated the steps I did, and it seems the reason is this:
- when ifupdown2 is installed, it generates /etc/network/interfaces.new

Code:
Setting up ifupdown2 (3.0.0-1+pve3) ...
Installing new version of config file /etc/default/networking ...


network config changes have been detected for ifupdown2 compatibility.
Saved in /etc/network/interfaces.new for hot-apply or next reboot.

- on reboot, this file is applied and then renamed to /etc/network/interfaces
 
yeah that makes sense. could you provide information about/contents of your interfaces file before the installation of ifupdown2 and afterwards? maybe we can improve the compat conversion logic?
 
(1) /etc/network/interfaces that I created manually:

Code:
### derived from a config generated using Proxmox-Setup Tool 1.2.1 from schaal @it UG
### https://schaal-it.com/script-to-install-proxmox-5-x-and-6-x-on-a-dedicated-hetzner-server/


# loopback device
auto lo
iface lo inet loopback


# primary network device
auto enp41s0
iface enp41s0 inet static
  address     1.2.3.149
  netmask     255.255.255.255
  gateway     1.2.3.129
  pointopoint 1.2.3.129
  up          sysctl -p


# <bridge-extra-IPs>
# Note:
# - `address` is the same as main IP
# - VM config is somewhat special
auto vmbr0
iface vmbr0 inet static
# extra public IPs
  address         1.2.3.149
  netmask         255.255.255.255
  bridge_ports    none
  bridge_stp      off
  bridge_fd       0
  bridge_maxwait  0
  pre-up          brctl addbr vmbr0


  # single extra IP:
  # up ip route add 1.2.3.4/32 dev vmbr0
# </bridge-extra-IPs>


# <vlan-4000>
# vlan raw device
auto enp41s0.4000
iface enp41s0.4000 inet static
  vlan-raw-device  enp41s0
  mtu              1400
  address          0.0.0.0
  netmask          0.0.0.0


# bridge
auto vmbr4000
iface vmbr4000 inet static
  bridge_ports  enp41s0.4000
  mtu           1400
  bridge_stp    off
  bridge_fd     0
# public net
# </vlan-4000>


# <vlan-4001>
# vlan raw device
auto enp41s0.4001
iface enp41s0.4001 inet static
  vlan-raw-device  enp41s0
  mtu              1400
  address          0.0.0.0
  netmask          0.0.0.0


# bridge
auto vmbr4001
iface vmbr4001 inet static
  bridge_ports  enp41s0.4001
  mtu           1400
  bridge_stp    off
  bridge_fd     0
  address       192.168.30.13
  netmask       24
# private net 4001
# </vlan-4001>


# <vlan-4002>
# vlan raw device
auto enp41s0.4002
iface enp41s0.4002 inet static
  vlan-raw-device  enp41s0
  mtu              1400
  address          0.0.0.0
  netmask          0.0.0.0


# bridge
auto vmbr4002
iface vmbr4002 inet static
  bridge_ports  enp41s0.4002
  mtu           1400
  bridge_stp    off
  bridge_fd     0
  address       192.168.40.13
  netmask       24
# private net 4002
# <vlan-4002>


# <vlan-4003>
# vlan raw device
auto enp41s0.4003
iface enp41s0.4003 inet static
  vlan-raw-device  enp41s0
  mtu              1400
  address          0.0.0.0
  netmask          0.0.0.0


# bridge
auto vmbr4003
iface vmbr4003 inet static
  bridge_ports  enp41s0.4003
  mtu           1400
  bridge_stp    off
  bridge_fd     0
  address       192.168.50.13
  netmask       24
# private net 4003
# </vlan-4003>


# <vlan-4010>
# vlan raw device
auto enp41s0.4010
iface enp41s0.4010 inet static
  vlan-raw-device  enp41s0
  mtu              1400
  address          0.0.0.0
  netmask          0.0.0.0


# vlan
auto vmbr4010
iface vmbr4010 inet static
  bridge_ports  enp41s0.4010
  mtu           1400
  bridge_stp    off
  bridge_fd     0
  address       192.168.110.13
  netmask       24
# private net 4010 (for pve-cluster)
# </vlan-4010>

(2) /etc/network/interfaces.new generated during apt install ifupdown2

Code:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!


auto lo
iface lo inet loopback


auto enp41s0
iface enp41s0 inet static
    address 1.2.3.149/32
    gateway 1.2.3.129
    pointopoint 1.2.3.129
    up          sysctl -p


auto enp41s0.4000
iface enp41s0.4000 inet static
    address 0.0.0.0
    mtu 1400


auto enp41s0.4001
iface enp41s0.4001 inet static
    address 0.0.0.0
    mtu 1400


auto enp41s0.4002
iface enp41s0.4002 inet static
    address 0.0.0.0
    mtu 1400


auto enp41s0.4003
iface enp41s0.4003 inet static
    address 0.0.0.0
    mtu 1400


auto enp41s0.4010
iface enp41s0.4010 inet static
    address 0.0.0.0
    mtu 1400


iface enp33s0 inet manual


auto vmbr0
iface vmbr0 inet static
    address 1.2.3.149/32
    bridge-ports none
    bridge-stp off
    bridge-fd 0
    bridge_maxwait  0
    pre-up          brctl addbr vmbr0
# extra public IPs


auto vmbr4000
iface vmbr4000 inet static
    bridge-ports enp41s0.4000
    bridge-stp off
    bridge-fd 0
    mtu 1400
# public net
# </vlan-4000>


auto vmbr4001
iface vmbr4001 inet static
    address 192.168.30.13/24
    bridge-ports enp41s0.4001
    bridge-stp off
    bridge-fd 0
    mtu 1400
# private net 4001
# </vlan-4001>


auto vmbr4002
iface vmbr4002 inet static
    address 192.168.40.13/24
    bridge-ports enp41s0.4002
    bridge-stp off
    bridge-fd 0
    mtu 1400
# private net 4002
# <vlan-4002>


auto vmbr4003
iface vmbr4003 inet static
    address 192.168.50.13/24
    bridge-ports enp41s0.4003
    bridge-stp off
    bridge-fd 0
    mtu 1400
# private net 4003
# </vlan-4003>


auto vmbr4010
iface vmbr4010 inet static
    address 192.168.110.13/24
    bridge-ports enp41s0.4010
    bridge-stp off
    bridge-fd 0
    mtu 1400
# private net 4010 (for pve-cluster)
# </vlan-4010>
 
unless I am missing something the only difference is:
- some comments were dropped
- the vlan-raw-device stanzas were dropped (they are not needed)
- the order of interfaces is different

but semantically, the resulting config is identical to the original?
 
yes you are right, the new content has only cosmetic changes compared to the orig. It works as expected; I am somewhat surprised by the auto-generating behavior.
 
  • Like
Reactions: fabian

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!