Subject: Re: Split traffic between two internet links?
To: Fernando Diniz Hammerli <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 03/19/2000 03:51:11
> I need to splt my internet traffic for two links, depending on the
> origin address:
> (Currently I'm using a NetBSD firewall/filter)

>    ------------------------         ------------------------
>       INTERNET - Link 1                 INTERNET - Link 2
>    ------------------------         ------------------------
>                 |                              | 
>                 |    ---------------------     |
>                 -----| FIREWALL / FILTER |------
>                      ---------------------
>                                |
>  _|________________|___________|_____________________________
>       |               My Internal Network                   |
>     xx.xx.zz.ww                                        xx.xx.10.yy

> (The links are connected via ethernet cable)

> I want only the packets coming from xx.xx.10.yy to be routed via link
> 2, otherwise must be via link 1.

> How can I do this? 

AFAIK there is no way to make routing decisions based on the *source*
address of the packet, in a stock system.

I wanted something very similar myself, except that the two netlinks
were not simple ethernets but rather tunnels layered atop PPPoE.  I
added an encap interface which both implemented the tunneling protocol
and peeked at the source address of the packet to decide which tunnel
to use - a single encap interface can handle multiple tunnels.  My
encap code will thus not be directly useful to you, though it would be
fairly easy to take it and rip out the tunneling stuff, instead
allowing userland to specify multiple underlying interfaces which it
would choose among based on the source address.

I'll be happy to send a copy to anyone who wants one; just drop me a
line requesting it....

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B