Stop PMG from removing `source` line in `/etc/network/interfaces`

May 20, 2017
172
18
58
Netherlands
cyberfusion.io
How do I stop PMG from removing the custom `source` line -which is supported according to the documentation- in `/etc/network/interfaces`?

Context:

I have some custom interfaces that PMG should not manage.

`/etc/network/interfaces` says:


# 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!


The documentation at https://pmg.proxmox.com/pmg-docs/chapter-pmgconfig.html contains the following example (at "Example network setup /etc/network/interfaces"):

Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
        address  192.168.2.127
        netmask  255.255.240.0
        gateway  192.168.2.1


When I add this `source` line, PMG removes it on the next configuration change. Diff:

Code:
--- /etc/network/interfaces    2023-05-03 11:31:58.088046589 +0200
+++ /etc/network/interfaces.new    2023-05-03 11:30:47.487496517 +0200
@@ -9,8 +9,6 @@
 # configuration from sourced files, so do not attempt to move any of
 # the PVE managed interfaces into external files!
 
-source /etc/network/interfaces.d/*
-
 auto lo
 iface lo inet loopback
 
@@ -26,3 +24,4 @@
     gateway 2a0c:eb00:0:f5:185:233:174:1
     dns-nameservers 2a03:7900:2:0:31:3:104:61 2a03:7900:2:0:31:3:104:62
     dns-search prorelay.nl
+
 

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!