WAN load balance with PF

Hooma Fazaeli hoomanfazaeli at gmail.com
Tue Nov 20 10:22:54 UTC 2012


On 11/20/2012 01:24 ?.?, Cpet Services wrote:
> http://forums.freebsd.org/showthread.php?t=30409 might help you. also 
> possibly with carp?
> *From:* Hooman Fazaeli <hoomanfazaeli at gmail.com 
> <mailto:hoomanfazaeli at gmail.com>>
> *Sent:* November 20, 2012 1:15 AM
> *To:* freebsd-pf at freebsd.org <mailto:freebsd-pf at freebsd.org>
> *Subject:* WAN load balance with PF
> With a topology like:
>                              ----- ADSL 1
> LAN ---- PF Box ----- Switch |
>                              ----- ADSL 2
>
> Is there a way to NAT and distribute LAN to internet traffic on the two
> ADSL links apart from adding a third NIC to PF box?
> _______________________________________________
> freebsd-pf at freebsd.org <mailto:freebsd-pf at freebsd.org> mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-pf
> To unsubscribe, send any mail to "freebsd-pf-unsubscribe at freebsd.org 
> <mailto:freebsd-pf-unsubscribe at freebsd.org>"
If we could connect both ADSl modems to the box, a config like below 
would work:

lan_if = "em0"
wan_if1 = "em1"
wan_if2 = "em2"

nat on $wan_if1 from $lan_if1:network to any -> $wan_if1
nat on $wan_if2 from $lan_if1:network to any -> $wan_if2

pass in on $lan_if route-to {($wan_if1 $wan_ip1) ($wan_if2 $wan_ip2)}
pass all

our problem is that since both WAN links are connected to the same 
interface (via the switch)
there is no way to distinguish between the two in NAT rules.

Any idea?



More information about the freebsd-pf mailing list