RE: routing to ping automatically via the correct network

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
This is how my test environment looks like. The 'host route' which I 
create with 192.192.168.114 is so health checks reach the container. 
This route is only set if the ip range is different from the range of 
the host.




ip netns add testing

ip link set testeth0 netns testing
ip link set testeth1 netns testing

ip netns exec testing bash

ifconfig testeth0 192.168.10.232
ifconfig testeth1 cc.cc.cc.43

# until this, enough to ping networks
# can ping 192.168.10.333, 192.168.10.2, cc.cc.cc.1
# not: own ip's?? cc.cc.cc.43, 192.168.10.232

ip route add default via cc.cc.cc.1 dev testeth1 table 81

# necessary for the host 192.192.168.114 to ping cc.cc.cc.43
ip route add 192.168.10.114 dev testeth1 scope global table 81

ip rule add from all to cc.cc.cc.43 table 81
ip rule add from cc.cc.cc.43 table 81

# can ping dd.dd.dd.130 







[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux