I'm running CentOS and are using ip route
and ip rule
for routing.
I've currently got an ip rule
from 10.8.23.0/28 table 1234
and ip route
default via 10.8.23.254 eth1
10.10.10.10 via 10.10.10.1 eth1
10.0.0.0/14 dev test-interface table 1234
It seems my ip rule
succeds the second line in ip route
, so even if destination IP is 10.10.10.10 my packets are still sent via test-interface
if source IP is 10.8.23.0/28
.
How can I make sure that 10.10.10.10 via 10.10.10.1 eth1
overrules the ìp rule` even when the source IP matches the rule? Hope it make sense :)
Testing ip route get 10.10.10.10
gives me:
10.10.10.10 via 10.10.10.1 dev eth1 src 10.8.23.1
but ip route get 10.10.10.10 src 10.0.0.13
gives me:
10.10.10.10 via 10.10.10.254 dev test-interface src 10.8.23.1
So src IP
is prioritized over destination IP.
ip rule
to define which routing table should be used for a given policy.ip route add 10.10.10.10 via 10.10.10.1 dev eth1
. how can I add a priority which is higher the theip rule add...
?