From: Arthur van Leeuwen <arthurvl@sci.kun.nl>
To: lartc@vger.kernel.org
Subject: RE: [LARTC] @home cable modem
Date: Fri, 06 Apr 2001 14:53:56 +0000 [thread overview]
Message-ID: <marc-lartc-98656889028163@msgid-missing> (raw)
In-Reply-To: <marc-lartc-98630489030178@msgid-missing>
Sorry for not responding earlier, I've been *extremely* busy.
On Fri, 6 Apr 2001, Josh Sides wrote:
> I would like to put 3 different ip addresses that are in three different
> subnets on the same interface. The interface is directly connected to a
> cable modem. These ip addresses are assigned to me by my ISP. How do I set
> up the routing on my linux machine so that all three addresses are reachable
> from the internet.
The simple recipe (in pseudocode, hope this is clear enough):
0. put the ip addresses on the interfaces:
for each ip/mask:
ip address add <ip/mask> dev <device>
1. set up the default routing table:
for each ip/mask:
ip route add <gw_for_ip> src <ip> dev <device>
ip route add default scope global \
nexthop via <gw_for_ip1> \
nexthop via <gw_for_ip2> \
nexthop via <gw_for_ip3>
(etcetera)
2. set up policy routing tables for each of the ip addresses:
for each ip/mask:
ip route add <ip/mask> dev <device> table <table_for_ip>
ip route add default via <gw_for_ip> table <table_for_ip>
3. set up rules to select the correct outgoing routes
for each ip/mask:
ip rule add from <ip/mask> table <table_for_ip> \
prio <arbitrary unique low number>
> Is it possible to setup multiple default routes?
More or less, yes. See in the recipe. :)
Doei, Arthur.
--
/\ / | arthurvl@sci.kun.nl | Work like you don't need the money
/__\ / | A friend is someone with whom | Love like you have never been hurt
/ \/__ | you can dare to be yourself | Dance like there's nobody watching
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/2.4Routing/
prev parent reply other threads:[~2001-04-06 14:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-03 13:28 [LARTC] @home cable modem Josh Sides
2001-04-03 13:38 ` Arthur van Leeuwen
2001-04-03 14:05 ` Josh Sides
2001-04-03 14:25 ` Josh Sides
2001-04-03 14:38 ` Arthur van Leeuwen
2001-04-03 14:40 ` Josh Sides
2001-04-06 14:12 ` Josh Sides
2001-04-06 14:53 ` Arthur van Leeuwen [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-98656889028163@msgid-missing \
--to=arthurvl@sci.kun.nl \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox