Es handelt sich um ein LXC Container
Folgendes im Container
happy# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
Und
happy#ip route default via 192.168.0.254 dev eth0 192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.248 192.168.10.0/24 dev eth1 proto kernel scope link src 192.168.10.198
und das
happy# ip rule show 0: from all lookup local 32764: from all to 192.168.10.198 lookup rt2 32765: from 192.168.10.198 lookup rt2 32766: from all lookup main 32767: from all lookup default
in Interfaces habe ich folgendes drin.
auto lo iface lo inet loopback auto eth0 # iface eth0 inet dhcp allow-hotplug eth0 iface eth0 inet static address 192.168.0.248 netmask 255.255.255.0 gateway 192.168.0.254 dns-nameservers 192.168.0.254 8.8.8.8 8.8.4.4 dns-search localhost # The secondary network interface allow-hotplug eth1 iface eth1 inet static address 192.168.10.198 netmask 255.255.255.0 post-up ip route add 192.168.10.0/24 dev eth1 src 192.168.10.198 table rt2 post-up ip route add default via 192.168.10.199 dev eth1 table rt2 post-up ip rule add from 192.168.10.198/32 table rt2 post-up ip rule add to 192.168.10.198/32 table rt2
rt2 hat Priorität 1
über eth0 gehts weiter zum WAN über eth1 gehts zur Bridge vom Host 192.168.10.199
Auf dem HOST habe Ich das Lokale Interface nicht BRIDGED , das will ich nicht. Wenn es Im Container nur ein Default GW 192.168.10.199 gesetzt ist, dann ist das NET 192.168.9.0 aus dem LXC Container erreichbar NAT funzt auch und alles wunderbar!
Host Bridge
....... auto br0 iface br0 inet static address 192.168.10.199 netmask 255.255.255.0 bridge_ports none .
Sobald aber ich 2 Getways und Routing Tabelle habe ,komme aus dem Container nicht auf das 192.168.9.0 NET raus, aber ich komme aus dem 192.168.9.0 in 192.168.10.0 rein (SSH , VNC und co.) 😲 !. wo ist mein Denkfehler?
Muss ich irgend wie statisches routing für LXC eth1 setzten dass auf das net 192.168.9.0 nur über 192.168.10.199 geht?