Re: routing to ping automatically via the correct network

Grant Taylor <[email protected]> Wed, 05 Aug 2020 23:22:09 +0000
Newsgroups org.kernel.vger.lartc
Message-ID <[email protected]>
On 8/5/20 4:20 PM, Marc Roos wrote:
> # 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

Bring the loopback interface up in the network namespace.  It's required 
to ping your local IPs.

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

What is the need for the separate routing table (81)?

Network namespaces have their own set of routing tables.

> # 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

Do you have a route to dd.dd.dd.130 in the main / default routing tables 
inside the network namespace?

If you don't, chances are good that the kernel can't determine an 
outgoing interface to determine the source IP to match any ip rules.

I don't see any need for table 81 in any of this.



-- 
Grant. . . .
unix || die
smime.p7s (application/pkcs7-signature, 3.9 KB) - not displayed