�Hola!

[You're forcing me to dialup to log in my servers to check how iproute
worked :-)]

[Please if somebody know how this really works please tell us.]

[I'm cc'ing to linux-net so somebody come and help us :-) ]

On Thu, Nov 05, 1998 at 08:30:50PM +0100, Arne Kuhlmann wrote:
>We are trying to do some "routing by source" on a linux machine.(Connections to
> two internet providers, each on a different Ethernet interface and  machines
> with IPs from each provider on the third network interface.)

> I have looked at ftp://ftp.inr.ac.ru/ip-routing/routing.tgz
> from Mike Mclagan which looked very simple to set up but the route.c would not
> compile since some of the includes were missing.
AFAIK, the Mike McLagan's source-based routing patches are considered
obsolete (because the policy-based routing oversedes (sp?) it)

>I also tried to install iproute2 with the latest 2.1.126 kernel, which worked
>fine,but I can't figure out how to set it up so that it will route based on the
> source IP. The documentation is pretty confusing.
"Pretty confusing" is almost an euphemism :-) I spent half a week to understand
(almost) how it works...

AFAIU the documentation is about a very old version.

> Can someone point me to some resources so that I can either figure out how to
> use
> "ip route" or how to compile McLagan's route.c??

Well, you have a "rules" table and some "routes" tables. The kernel first
go through (sp?) the rules table. When some rule matches it goes to the
route table that the rule referred to. If no rule matches it goes to the
"main" route table. The routes table are similar to the non-policy-based
routing tables that are handled with route.

A very simple example to do a source-based routing would be:

ip ro add 0/0 gw 192.168.1.1 # That goes to the "main" (ie default) routing
                                # table. So 192.168.1.1 will be our default
                                # gw

ip ru add from 192.168.2.0/0 to 0/0 table 1 # We will route all what comes
                        # from the C class 192.168.2.0 via the table 1

ip ro add 0/0 gw 192.168.1.2 table 1 # So we are routing all that
                # comes from 192.168.2.* via the .2, not the .1

I hope it helps. Sorry for my poor english.

> Thanks,
> Arne Kuhlmann

                                        HoraPe
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to