two ISP connections, three nics, and a NAT

Ash omniBSD at speakeasy.net
Thu May 12 08:02:13 PDT 2005


Greg Donald wrote:
> I have two ISP connections, a DSL line and a Cable Modem line.  I want
> to plug both connections into a FreeBSD box that has three nics in it,
> one nic for each ISP connection and the last nic for my NAT.  How can
> I bind the connections together without any other sort of router? 
> I've used ipfw a bit over the past couple of years, and I've got a
> basic NAT working for the other LAN PCs.  I can't seem to find any
> docs on how to proceed with two connections however.  I've got two
> connections for the sake of failover but it'd be nice to actually use
> both of them instead of one or the other sitting idle all the time. 
> Would it be as simple as adding a static route from each connection to
> the other?
> 
> If anyone has any tips or URLs that'd be helpful.
> 
> TIA.
> 
> 


Short answer: You can't.


Long answer: You can't bind the two connections from two different ISPs 
into a single connection, it's just not the way IP works. What you can 
do however, is distribute the network load evenly across the two 
connections through your router. You already have a router: Your FreeBSD 
box.

One method you can try, is to distribute the load one a per machine 
basis. Let's say you have 4 computers in your LAN A, B, C and D. You can 
configure your router to send traffic originating from A and B through 
ISP 1, while C and D are routed through ISP 2. Unfortunately, I haven't 
used IPFW in a long enough time that I can't remember much about it, so 
I'm not sure if IPFW will allow you to do this (I *think* it does, but 
I'm too lazy to look it up). However, I do know that pf(4) (Firewall 
package ported over from OpenBSD and imported into 5.x in March of 2004) 
will allow you to do this. In case you want to examine the PF option, 
you may want to have a look at the Users Guide 
(ftp://ftp.openbsd.org/pub/OpenBSD/doc/pf-faq.txt) as well as an 
overview (http://www.bgnett.no/~peter/pf/).


-Ash


More information about the freebsd-questions mailing list