From: "Martin A. Brown" <mabrown-lartc@securepipe.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Changing default route for an entire subnet/NIC
Date: Thu, 18 Dec 2003 22:54:54 +0000 [thread overview]
Message-ID: <marc-lartc-107178978005480@msgid-missing> (raw)
In-Reply-To: <marc-lartc-107172912901834@msgid-missing>
Brian,
: Oops, made a mistake in my example,
: I actually enter
: ip rule add from 192.168.0.0/24 table John
:
: As soon as I do this, that subnet loses all contact with my firewall,
: so it can't DHCP an address, do DNS servers, ping, anything..
Perhaps what you wish to do is copy the entire main routing table to the
table "John" [0] and then change the default route in that table.
Try:
# copy_routing_table John
# ip route change table John default via $OTHER_GATEWAY
This is a simple application of policy routing. Another possibility is to
exclude 192.168.0.0/24 from the rule itself:
# ip rule add from 192.168.0.0/24 table John
# ip rule add from 192.168.0.0/24 to 192.168.0.0/24 table main
You may wish to consider adding the prio keyword explicitly. See also
some documents I have written in which I attempt to explain the policy
routing system in plain terms [1].
Good luck,
-Martin
[0] http://linux-ip.net/html/scripts/copy-routing-table.sh
[1] http://linux-ip.net/html/ch-routing.html
--
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
prev parent reply other threads:[~2003-12-18 22:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-18 5:34 [LARTC] Changing default route for an entire subnet/NIC brian
2003-12-18 7:03 ` Brian Weaver
2003-12-18 22:54 ` Martin A. Brown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-lartc-107178978005480@msgid-missing \
--to=mabrown-lartc@securepipe.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.