RE: [LARTC] @home cable modem

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx      | 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




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux