Network routing and Multiple ADSL lines

Geraint Edwards gedge-lists at
Mon Aug 7 12:50:18 BST 2006

Paul <freebsd at> said
		(on Sun, Aug 06, 2006 at 08:54:41PM -0400):
> I currently have my default gateway on FreeBSD set to

I have a similar setup.  I use cable (NTL) for personal use and
have ADSL (Plusnet) for more work-related things - both patched
into my FreeBSD box through different NICs.

My solution to your problem would be to use a static route.

> What I really want is for the alpha to have a default gateway of 
> (I use it for personal tasks as well as for my friend), to 
> be able to connect to it internally from the network, 
> and externally using the IP from the first ADSL line
> I would also like to be able to connect to it externally using the IP 
> address from the seconds ADSL line, so my friend can backup to it 
> using rsync and also use it as a DNS server

If your friend has a static IP, or a known range of IPs (let's
say it is then you could use that range to setup a
static route which goes via the 2nd ADSL line.

Of course, all traffic to from hosts with this
static route will be routed via the 2nd/ADSL line, but that's not
a problem for me.

Here's my solution for this (I have three static routes for known
Plusnet ranges):

In /etc/rc.conf I have something like this:

static_routes="foo1_via_plus foo2_via_plus foo3_via_plus"
route_foo1_via_plus="-net -netmask ${myvars__adsl2_gw}"
route_foo2_via_plus="-net  -netmask   ${myvars__adsl2_gw}"
route_foo3_via_plus="-net    -netmask   ${myvars__adsl2_gw}"

So, yours would be something like this:

route_pal_via_adsl2="-net -netmask ${myvars__adsl2_gw}"

Reboot... et voila!

For Windows boxes that need to use these routes (of course, they
have to be connected to the 2nd router too, or perhaps route via
the FreeBSD box), I use Samba login scripts.  My Windows hosts
login to Samba running on my FreeBSD box, and I have a shell
script which extracts the above routes from rc.conf and creates a
.BAT file, which sets up the Windows box with those static routes
when users log in.  Automagically.

If you want more details, let me know privately and I'll share
(my setup is - in reality - a bit more complicated than the
example above, so I'd need to tweak to suit).  If enough people
contact me, I'll post to the list.

Hope this helps,

Geraint A. Edwards (aka "Gedge")
gedge at

More information about the Ukfreebsd mailing list