Professional Documents
Culture Documents
A Quick Introduction To Linux Policy Routing
A Quick Introduction To Linux Policy Routing
A Quick Introduction To Linux Policy Routing
• Policy routing rules: Again, Linux comes with three rules, one
for each of the default routing tables.
This creates the table with the ID 200 and the name “custom”.
You’ll reference this name later as you create the rules and
populate the table with routes, so make note of it. Because this
entry is contained in the rt_tables �le, it will be persistent
across reboots.
Let’s say that we wanted to create a rule that told the system to use
the “custom” table we created earlier for all traf�c originating from
the source address 192.168.30.200. The command would look like
this:
You can see all the policy routing rules that are currently in effect
using this command:
ip rule list
As with the policy routing tables, routes added this way are not
persistent, so you’ll want to make them persistent by adding a line
like this to your /etc/network/interfaces con�guration �le:
Additional Resources
The policyrouting.org web site is a great resource; I highly
recommend reviewing some of the information found there.
Summary
There’s a great deal more functionality possible in policy routing,
but this at least gives you the basics you need to understand how it
works. In a future post, I’ll provide a speci�c use case where this
functionality could be put to work. In the meantime, feel free to
share any corrections, clari�cations, questions, or thoughts by
contacting me on Twitter.
Related Posts
VLAN Trunking to Guest Domains with Open vSwitch 28 May 2013
Using GRE Tunnels with Open vSwitch 7 May 2013
Technology Short Take #29 4 Feb 2013