Hi p.H
Here's the content you requested
It should match closely to what was written in that link of my first post.
Code: Select all
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug enp6s0
iface enp6s0 inet static
address 192.168.2.5
netmask 255.255.255.0
# This is an autoconfigured IPv6 interface
iface enp6s0 inet6 auto
# WAN interface
allow-hotplug enp1s0
iface enp1s0 inet manual
# WAN bridge
auto wanbr
iface wanbr inet dhcp
bridge_ports enp1s0
bridge_waitport 0 # no delay before a port becomes available
bridge_fd 0 # no forwarding delay
bridge_maxwait 0
# LAN interfaces
allow-hotplug enp2s0
iface enp1s0 inet manual
allow-hotplug enp3s0
iface enp1s0 inet manual
allow-hotplug enp4s0
iface enp1s0 inet manual
allow-hotplug enp5s0
iface enp1s0 inet manual
# LAN Bridge
auto lanbr
iface lanbr inet manual
pre-up ip link add veth-p6 type veth peer name veth-lanbr
pre-up ip addr add 192.168.1.5/24 dev veth-p6
pre-up ip link set veth-p6 up
pre-up ip link set veth-lanbr up
post-up ip route add default via 192.168.1.1 dev veth-p6
post-up iptables -t nat -A POSTROUTING -o veth-p6 -j MASQUERADE
bridge_ports enp2s0 enp3s0 enp4s0 enp5s0 veth-lanbr
bridge_waitport 0 # no delay before a port becomes available
bridge_fd 0 # no forwarding delay
bridge_maxwait 0
bridge_stp on
What you wrote makes sense but I was wondering:
* The gateway 192.168.1.1 can't ever exist before startup of the host and it's networking since it runs as a vm under this host using this lanbr bridge.
Does the existence of the ip-address 192.168.1.5/24 (the veth-pair) not warrant enough the route creation to 192.168.1.1?
I suppose the route line is written here because of the pre-up reflecting on the lanbr and the other pre-ups entries (veth-pair etc).
* but why pre-up? I tried using post-up (in the code above), since at least it doesn't break the lanbr-creation but nor the route nor the NAT-rule are created in the end.
Thank you already for your insights.
Steven