History

fib_rules: add .suppress operation

This change adds a new operation to the fib_rules_ops struct; it allows the suppression of routing decisions if certain criteria are not met by its results. The first implemented constraint is a minimum prefix length added to the structures of routing rules. If a rule is added with a minimum prefix length >0, only routes meeting this threshold will be considered. Any other (more general) routing table entries will be ignored. When configuring a system with multiple network uplinks and default routes, it is often convinient to reference the main routing table multiple times - but omitting the default route. Using this patch and a modified "ip" utility, this can be achieved by using the following command sequence: $ ip route add table secuplink default via 10.42.23.1 $ ip rule add pref 100 table main prefixlength 1 $ ip rule add pref 150 fwmark 0xA table secuplink With this setup, packets marked 0xA will be processed by the additional routing table "secuplink", but only if no suitable route in the main routing table can be found. By using a minimal prefixlength of 1, the default route (/0) of the table "main" is hidden to packets processed by rule 100; packets traveling to destinations with more specific routing entries are processed as usual.

Stefan Tomanek committed 13 years ago

Commit 7764a451 parent 5c152575 files · +40 −1Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/fib_rules.h+1−1
@@ -45,7 +45,7 @@ enum { · 44 unmodified lines
4545 FRA_FLOW, /* flow/class id */
4646 FRA_UNUSED6,
4747 FRA_UNUSED7,
48− FRA_UNUSED8,
48+ FRA_TABLE_PREFIXLEN_MIN,
4949 FRA_TABLE, /* Extended table id */
5050 FRA_FWMASK, /* mask for netfilter mark */
5151 FRA_OIFNAME,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t