+- its fine just missed `post-up /sbin/ip route add default via 199.168.137.1 dev vmbr1 table net2` to change NIC name
Thanks for this catch. I've changed that, but it still doesn't allow me to connect to container with 199.168.137.3 IP (it timeouts).
My interfaces file
Code:
# network interface settings
auto lo
iface lo inet loopback
iface eth0 inet manual
iface eth1 inet manual
auto vmbr0
iface vmbr0 inet static
address 162.213.31.137
netmask 255.255.255.0
gateway 162.213.31.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
auto vmbr0:0
iface vmbr0:0 inet static
address 199.168.137.2
netmask 255.255.255.0
post-up /sbin/ifconfig vmbr0:0 199.168.137.2 netmask 255.255.255.0
# Routes for net1
post-up /sbin/ip route add 199.168.137.0/24 dev vmbr0:0 proto kernel scope link src 199.168.137.2 table net1
post-up /sbin/ip route add 162.213.31.0/24 dev vmbr0 proto kernel scope link src 162.213.31.137 table net1
post-up /sbin/ip route add default via 162.213.31.1 dev vmbr0 table net1
# Routes for net2
post-up /sbin/ip route add 199.168.137.0/24 dev vmbr0:0 proto kernel scope link src 199.168.137.2 table net2
post-up /sbin/ip route add 162.213.31.0/24 dev vmbr0 proto kernel scope link src 162.213.31.137 table net2
post-up /sbin/ip route add default via 199.168.137.1 dev vmbr0:0 table net2
# Rules
post-up /sbin/ip rule add from all to 162.213.31.0/24 lookup net1
post-up /sbin/ip rule add from 162.213.31.0/24 to all lookup net1
post-up /sbin/ip rule add from all to 199.168.137.0/24 lookup net2
post-up /sbin/ip rule add from 199.168.137.0/24 to all lookup net2
From machine running Proxmox I can ping its IP from second subnet (199.168.137.2), but when ping is being routed through second NIC (for example when I ping router (199.168.137.1) it says:
Code:
PING 199.168.137.1 (199.168.137.1) 56(84) bytes of data.From 199.168.137.2 icmp_seq=2 Destination Host Unreachable
From 199.168.137.2 icmp_seq=3 Destination Host Unreachable
From 199.168.137.2 icmp_seq=4 Destination Host Unreachable
PING 199.168.137.2 (199.168.137.2) 56(84) bytes of data.
64 bytes from 199.168.137.2: icmp_req=1 ttl=64 time=0.028 ms
64 bytes from 199.168.137.2: icmp_req=2 ttl=64 time=0.029 ms
64 bytes from 199.168.137.2: icmp_req=3 ttl=64 time=0.028 ms
64 bytes from 199.168.137.2: icmp_req=4 ttl=64 time=0.032 ms
IP of container in new subnet
PING 199.168.137.3 (199.168.137.3) 56(84) bytes of data.
From 199.168.137.2 icmp_seq=2 Destination Host Unreachable
From 199.168.137.2 icmp_seq=3 Destination Host Unreachable
From 199.168.137.2 icmp_seq=4 Destination Host Unreachable
All rules and routes are set:
Code:
0: from all lookup local32762: from 199.168.137.0/24 lookup net2
32763: from all to 199.168.137.0/24 lookup net2
32764: from 162.213.31.0/24 lookup net1
32765: from all to 162.213.31.0/24 lookup net1
32766: from all lookup main
32767: from all lookup default
If it's important net1 has priority 101, and net2 has 102.
I have no idea what's wrong with that. Maybe it's my provider fault?
One more time, thanks for your help.