Commit Graph

82 Commits

Author SHA1 Message Date
Stefan Tomanek
b1d0525f9c ip rule: add route suppression options
When configuring a system with multiple network uplinks and default routes, it
is often convenient to reference a routing table multiple times - but reject
its routing decision if certain constraints are not met by it.

Consider this setup:

$ ip route add table secuplink default via 10.42.23.1

$ ip rule add pref 100            table main suppress_prefixlength 0
$ 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 suppressing entries with a prefixlength of 0 (or less), the
default route (/0) of the table "main" is hidden to packets processed by rule
100; packets traveling to destinations via more specific routes are processed
as usual.

It is also possible to suppress a routing entry if a device belonging to
a specific interface group is to be used:

$ ip rule add pref 150 table main suppress_group 1

Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
2013-08-04 11:54:15 -07:00
Stephen Hemminger
ff24746cca Convert to use rta_getattr_ functions
User new functions (inspired by libmnl) to do type safe access
of routeing attributes
2012-04-10 08:47:55 -07:00
Stephen Hemminger
cd70f3f522 libnetlink: remove unused junk callback
Both rtnl_talk and rtnl_dump had a callback for handling portions
of netlink message that do not match the correct pid or seq.
But this callback was never used by any part of iproute2 so remove
it.
2011-12-28 10:37:12 -08:00
Arnd Hannemann
dec01609dc iproute2: Add dsfield as alias for tos for ip rules
Get ip rule parsing of "dsfield" in sync with ip route parsing and manual page.

Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
2010-07-23 12:27:14 -07:00
Ben Greear
0d1c9b570a iproute2: Fix batch-mode for mrules.
The do_multirule logic was broken in batch mode because
it expected the preferred_family to be AF_INET or AF_INET6,
but it then assigned it to RTNL_FAMILY_IPMR or RTNL_FAMILY_IP6MR.
So, the next iteration of the batch processing, it failed
the check for AF_INET or AF_INET6.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2010-07-23 09:03:12 -07:00
Patrick McHardy
b6c8e808fc ip: add support for multicast rules
commit 44a5293c1c47b8c32d9bb0756660ea5d4802acf2
Author: Patrick McHardy <kaber@trash.net>
Date:   Tue Apr 13 17:03:47 2010 +0200

    ip: add support for multicast rules

    Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-06-09 08:49:24 -07:00
Patrick McHardy
85eae222d2 iprule: add oif classification support
David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 30 Nov 2009 19:00:14 +0100
>
>> This patch contains iproute support for iprule oif classification
>> for the send-to-self RFC I just sent out.
>
> Patrick, you need to submit a new version of this patch with
> the FIB_RULE_* macro fixed, just like the kernel version got
> fixed.

Thanks for reminind me of this. New patch attached.

commit 0fe5164cbaa1d65dda341075710be71bf1f32d10
Author: Patrick McHardy <kaber@trash.net>
Date:   Fri Dec 4 07:06:18 2009 +0100

    iprule: add oif classification support

    Signed-off-by: Patrick McHardy <kaber@trash.net>
2009-12-26 11:14:22 -08:00
Stephen Hemminger
232642c28c Remove Changes: comments
Discourage developers from putting change log in comments
now that software has been under change control for 5 years.
2009-12-01 15:49:48 -08:00
Andreas Henriksson
ed6a021a92 iproute2: revert syntax help text mistake.
Sorry. The pref and prio options are actually synonyms.
This reverts part of commit 576c63ee59.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
2008-01-02 16:33:24 -08:00
Alexander Wirt
576c63ee59 Add parameters to usage help text.
Add src option to route help text (http://bugs.debian.org/226142).
Add prio option to rule prio help text (http://bugs.debian.org/213673).

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-10-17 09:58:11 -07:00
Stephen Hemminger
59cc4f73f2 Revert "Remove bogus reference to tc-filters(8) from tc(8) manpage."
This reverts commit 1bacc7ce75.
2007-10-12 15:44:07 -07:00
Andreas Barth
1bacc7ce75 Remove bogus reference to tc-filters(8) from tc(8) manpage.
Spotted by Aleš Kozumplík <al_es@seznam.cz>
(http://bugs.debian.org/289225)

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-10-12 14:55:42 -07:00
Patrick McHardy
ad1a12dbd0 Use FRA_* attributes for routing rules
Use the FRA attributes for routing rules, with exception of RTA_GATEWAY
(used for route-NAT) which isn't supported by current kernels anymore
and thus doesn't exist as FRA attribute.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2007-08-22 10:26:12 -07:00
Thomas Graf
6b469caefd iproute2: support for goto/nop action and detached flag
Stephen,

Patch to support the new fib rules features I just posted
on netdev.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
2007-06-19 15:57:27 -07:00
Stephen Hemminger
81c61790d5 Eliminate trailing whitespace
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-12-13 17:05:50 -08:00
Patrick McHardy
be7f286e83 [IPROUTE]: Add support for routing rule fwmark masks
Needs kernel >= 2.6.19.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2006-12-13 16:58:32 -08:00
Stephen Hemminger
ae665a522b Remove trailing whitespace
Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-12-05 10:10:22 -08:00
Thomas Graf
98bde989db Add rule notification support to ip monitor
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-10 09:40:30 -08:00
Thomas Graf
3123a0ccdd Add support for inverted selectors
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-11-09 08:51:29 -08:00
Patrick McHardy
34e9564753 Add support for larger number of routing tables
[IPROUTE]: Add support for larger number of routing tables

Support support for 2^32 routing tables by using the new RTA_TABLE
attribute for specifying tables > 255 and intepreting it if it is
sent by the kernel.

When tables > 255 are used on a kernel not supporting it an error will
occur because of the unknown netlink attribute.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-08-10 16:12:07 -07:00
shemminger
b77caeba0e Fix ip rule flush 2005-10-12 22:32:34 +00:00
shemminger
351efcde4e Update header files to 2.6.14
Integrate support for DCCP and tcp_diag into ss
Add -batch to ip command
2005-09-01 19:21:50 +00:00
shemminger
660818498d Update include files and fix a couple of minor bugs 2005-08-16 21:10:51 +00:00
shemminger
f332d16924 Cleanup GCC4 warnings about signedness. 2005-07-05 22:37:15 +00:00
7!tgraf
2af5c3d344 tb buffer initialization is now done in the parser
(Logical change 1.129)
2005-01-18 22:11:58 +00:00
net[shemminger]!shemminger
526afe4008 Import patch iproute2.113
(Logical change 1.115)
2005-01-17 23:27:23 +00:00
osdl.net!shemminger
50772dc51a Add ip rule flush capabilty and fix all the prototype changes
because of that code rewrites the nlmsghdr.

(Logical change 1.106)
2004-12-07 21:48:29 +00:00
net[shemminger]!shemminger
0284dcde32 Import patch iproute2-typo-fixes-1.diff
(Logical change 1.94)
2004-10-07 18:56:07 +00:00
osdl.net!shemminger
6dc9f01634 make all filtering handles take const args.
(Logical change 1.77)
2004-08-31 17:45:21 +00:00
org[shemminger]!shemminger
4fb466f944 Import patch iproute2-2.4.7-hex.patch
(Logical change 1.8)
2004-06-07 22:02:48 +00:00
osdl.org!shemminger
aba5acdfdb (Logical change 1.3) 2004-04-15 20:56:59 +00:00
osdl.org!shemminger
86fdf0e47b Initial revision 2004-04-15 20:56:59 +00:00