I'm trying to route packets
based on their source
address
, and have added the following:
# ip rule add from 10.10.10.0/16 dev eth0 table foobar
# ip route add default via 100.100.100.1 dev eth0 table foobar
Testing the routing however gives me wrong via
address:
# ip route get 4.3.2.1 from 10.10.10.1
4.3.2.1 from 10.10.10.1 via 100.0.0.1 dev eth0
Why doesn't this get respected?
This is my regular routes
# ip route list
default via 100.0.0.1 dev eth0
and
# ip route show table foobar
default via 100.100.100.1 dev eth0
and
# ip rule list
0: from all lookup local
32765: from 10.10.10.0/16 iif eth0 lookup foobar
32766: from all lookup main
32767: from all lookup default