Red Hat Bugzilla – Bug 1470045
Feature: Support policy-based routing / Separate routing-tables per interfaces/defaultroutes
Last modified: 2017-08-16 07:22:13 EDT
Linux itself supports multiple routing-tables. But the init-scripts don't yet know such a parameter per-interface or for the defaultroutes.
With multiple tables it would be easy to have a server multihomed on two networks and use the correct defaultroute via either interface depending on the ip/interface used.
The table for eth0 should route traffic via the gateway at 198.51.100.1 if it cannot be delivered directly:
ip route add 198.51.100.0/24 dev eth0 table 1
ip route add default via 198.51.100.1 table 1
whereas the table for eth1 should use the gateway at 203.0.113.1:
ip route add 203.0.113.0/24 dev eth1 table 2
ip route add default via 203.0.113.1 table 2
I forgot to add to the example of course policy-rules are needed as well (as documented in that howto):
ip rule add from 198.51.100.87/32 table 1 priority 100
ip rule add from 203.0.113.144/32 table 2 priority 110
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.