/etc/network/interfaces 2 NIC's 2 gateway's

Forssux

Member
Mar 27, 2022
62
4
13
I'm running Proxmox 8.3.3

I have a Unifi UDM Pro on Port 6 is the actual cable to vmbr1 (192.168.40.7) and a cable on Port 26 from a UNIF 24 POE Switch.
Both have on their port.
Native VLAN / Network NONE
Tagged VLAN Management Allow ALL

I have a LAN-VM-LXC 192.168.40.0/24 VLAN tag=40
I have a LAN-VET 192.168.1.0/24 VLAN tag=1
I have a LAN-OUD 192.168.2.0/24 VLAN tag=2
I have a LAN-CAM 192.168.4.0/24 VLAN tag=4

My /etc/network/interfaces has this:

Code:
auto lo
iface lo inet loopback
iface enp9s0f0 inet manual
auto eno1
iface eno1 inet manual
iface eno2 inet manual
iface enp65s0f0 inet manual
iface enp65s0f1 inet manual
auto enp9s0f1
iface enp9s0f1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 192.168.1.5/24
        gateway 192.168.1.1
        bridge-ports enp9s0f0
        bridge-stp off
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-500

auto vmbr1
iface vmbr1 inet static
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-500
#       address 192.168.40.7/24
auto vmbr1.40
iface vmbr1.40 inet static
        address 192.168.40.7/24
        gateway 192.168.40.1


This solution worked for Frigate, Home Assistant on my fixed PC but because the SMB only worked on fixed PC and not GSM I commented out the 192.168.40.1 gateway and now I can't connect to Home Assistant (192.168.40.30) or Frigate (192.168.4.39) anymore on my PC or GSM.
When I reapply the 192.168.40.1 gateway I have to reboot to connect to HA, Frigate A systemctl restart networking or ifreload -a isn't enough to get a working state..

However I still can't reach SMB from phone
 
Last edited:
If you configure two gateways, only one will work as there can not be two default gateways in same routing table. Use additional more specific routing entries in the config or have a look at policy based routing instead of a second gateway.
in other words: your config is
0.0.0.0/0 is reachable via 192.168.1.1 AND
0.0.0.0/0 is reachable via 192.168.40.1
but only a single default (0.0.0.0/0) route will work.
 
  • Like
Reactions: Forssux and fabian