Skip to content
Snippets Groups Projects
Commit 5adef180 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

net 04/05: fib_rules: allow to delete local rule


commit d124356ce314fff22a047ea334379d5105b2d834
Author: Patrick McHardy <kaber@trash.net>
Date:   Thu Dec 3 12:16:35 2009 +0100

    net: fib_rules: allow to delete local rule

    Allow to delete the local rule and recreate it with a higher priority. This
    can be used to force packets with a local destination out on the wire instead
    of routing them to loopback. Additionally this patch allows to recreate rules
    with a priority of 0.

    Combined with the previous patch to allow oif classification, a socket can
    be bound to the desired interface and packets routed to the wire like this:

    # move local rule to lower priority
    ip rule add pref 1000 lookup local
    ip rule del pref 0

    # route packets of sockets bound to eth0 to the wire independant
    # of the destination address
    ip rule add pref 100 oif eth0 lookup 100
    ip route add default dev eth0 table 100

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b038a5e
No related branches found
Tags v3.19-rc3
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment