Load Balancing for Dual ISP (Internet Service Provider)
this is the file /etc/pf.conf, with decription above
in_if=”rl0″ /*for internal network interface*/
ext_if0=”tun0″ /*external interface 1 connect to modem ADSL*/
ext_if1=”tun1″ /*external interface 2 connect to modem ADSL*/
ext_gw1=”125.163.xxxx.xxxx” /*gateway, setup by ISP*/
priv_addr=”192.16.1.0/24″
nat on $ext_if0 from $priv_addr -> $ext_if0
nat on $ext_if1 from $priv_addr -> $ext_if1
pass out on $in_if from any to $priv_addr
/*syntaks for load balancing*/
pass in on rl0 route-to { (tun0 $ext_gw1), (tun1 $ext_gw1) } round-robin proto tcp from $priv_addr to any keep state
/*syntaks for load balancing*/
pass in on $in_if route-to { (tun0 $ext_gw1),(tun1 $ext_gw1) } round-robin proto {icmp,udp} from $priv_addr to any keep state
pass in on rl0 proto tcp from $priv_addr to any port 22 keep state
pass in on rl0 proto udp from any to any port 161 keep state
pass out on $ext_if0 proto tcp from any to any keep state
pass out on $ext_if0 proto {udp,icmp} from any to any keep state
pass out on $ext_if1 proto tcp from any to any keep state
pass out on $ext_if1 proto {udp,icmp} from any to any keep state