My /etc/network/interfaces:
auto lo
iface lo inet loopback
auto wan
iface wan inet static
address $myPublicIP
netmask $ispSubnet
gateway $ispGateway
auto vpn
iface vpn inet static
address 10.102.1.194
netmask 255.255.255.192
up ip route add 192.168.10.32/27 via 10.102.1.196 dev vpn src 10.102.1.194 metric 10
up ip route add 192.168.11.0/24 via 10.102.1.196 dev vpn src 10.102.1.194 metric 10
ip r
shows as expected:
default via $wanGateway dev wan onlink
$wanGateway/$wanCIDR dev wan proto kernel scope link src $wanIP
10.102.1.192/26 dev vpn proto kernel scope link src 10.102.1.194
192.168.10.32/27 via 10.102.1.196 dev vpn src 10.102.1.194 metric 10
192.168.11.0/24 via 10.102.1.196 dev vpn src 10.102.1.194 metric 10
But even after reboot, traffic goes via LAN (a.k.a vpn
) gateway, 10.102.1.193/27:
traceroute to 192.168.11.2 (192.168.11.2), 30 hops max, 60 byte packets
1 10.102.1.193 (10.102.1.193) 368.435 ms 368.370 ms 368.316 ms^C
This is Debian 10 LXC container under Proxmox VE 6.0-9. Is it the culprit, or am I missing something there? I tried this answer, but it didn't work for some reason - adding table and/or ip rule doesn't affect the outcome.
ip route get 192.168.11.2
&ip route show match 192.168.11.2
?metric
?