pve generated interfaces.d/sdn uses wrong --to-source IP address

mouk

Renowned Member
May 3, 2016
40
0
71
53
Hi,

We have a 5-node cluster, 1.2.3.192 - 1.2.3.196, using a 10G direct fibre connection between the five (called dev hsl) and the following /etc/network/interfaces on host pve3:

Code:
root@pve3:/etc/network# cat interfaces
# 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

iface idrac inet manual

auto eno1
iface eno1 inet manual

iface enp130s0f0 inet manual

auto eno2
iface eno2 inet manual

auto eno3
iface eno3 inet manual

iface enp130s0f1 inet manual

auto eno4
iface eno4 inet static
    address 192.168.1.2/24

auto bond0
iface bond0 inet manual
    bond-slaves eno1 eno2
    bond-miimon 100
    bond-mode 802.3ad
    bond-xmit-hash-policy layer2+3

auto vmbr0
iface vmbr0 inet static
    address 1.2.3.194/24
    gateway 1.2.3.6
    bridge-ports bond0
    bridge-stp off
    bridge-fd 0
    bridge-vlan-aware yes
    bridge-vids 2-4094

auto hsl
iface hsl inet manual
    bridge-ports enp130s0f0 enp130s0f1
    bridge-stp on
    bridge-fd 2
    bridge-vlan-aware yes
    bridge-vids 2-4094
    bridge_priority 4096
    post-up ip route add 1.2.3.192/32 dev hsl
    post-up ip route add 1.2.3.193/32 dev hsl
    post-up ip route add 1.2.3.195/32 dev hsl
    post-up ip route add 1.2.3.196/32 dev hsl
    post-down ip route del 1.2.3.192/32 dev hsl
    post-down ip route del 1.2.3.193/32 dev hsl
    post-down ip route del 1.2.3.195/32 dev hsl
    post-down ip route del 1.2.3.196/32 dev hsl

eno4 is connected to a 5G modem device that we are testing on ip 192.168.1.1

We also use simple sdn, 10.20.30.0/24, and now it comes: the generated sdn config looks like this:

Code:
root@pve3:/etc/network# cat ./interfaces.d/sdn
#version:11

auto host
iface host
    address 10.20.30.1/24
    post-up iptables -t nat -A POSTROUTING -s '10.20.30.0/24' -o eno4 -j SNAT --to-source 192.168.1.2
    post-down iptables -t nat -D POSTROUTING -s '10.20.30.0/24' -o eno4 -j SNAT --to-source 192.168.1.2
    post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
    post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    ip-forward on

auto vlan
iface vlan
    bridge_ports hsl.4
    bridge_stp off
    bridge_fd 0

We don't understand why the sdn config contains --to-source 192.168.1.2 and -o eno4. On other cluster nodes, --to-source and -o vmbr0 are set correctly local ip address (1.2.3.X) and device. The above settings on this particular host breaks *many* things.

Can anyone explain how to keep the eno4 config, and also get a valid sdn config? I don't think manually editing the sdn file is a valid way forward as it probably will be overwritten at any time...?

Thanks in advance!
 
Last edited: