#=====================================================
#load balancing dua koneksi induk speedy & isp dengan pf
#=====================================================
lan_net = "192.168.0.0/24" // ip lan
int_if = "rl2" //lan
ext_if1 = "rl0" // isp
ext_if2 = "rl1" // modem speedy
ext_gw1 = "xxx.xxx.xxx.xxx" //isp
ext_gw2 = "192.168.111.2" // modem speedy
set loginterface $ext_if1
set loginterface $ext_if2
set optimization aggressive
# scrub all
scrub in all
# nat outgoing connections on each internet interface
#nat on $int_if from {192.168.0.200} to any -> ($ext_if2)
#nat on $ext_if1 proto {tcp,udp,icmp} from $lan_net to any -> $ext_gw1
#nat on $ext_if2 proto tcp from {192.168.0.200} to any -> $ext_if2
#rdr on $int_if proto tcp from any to any port 21 -> 192.168.0.1 port 21
nat on $ext_if1 from $lan_net to any -> ($ext_if1)
nat on $ext_if2 from $lan_net to any -> ($ext_if2)
nat on $ext_if1 from $int_if to any -> ($ext_if1)
nat on $ext_if2 from $int_if to any -> ($ext_if2)
#rdr on $int_if proto tcp from {192.168.0.200,192.168.0.9,192.168.0.10,192.168.0.11} to any port www -> 192.168.0.1 port 3128
#rdr on $int_if proto tcp from {192.168.0.200} to any port www -> 192.168.0.1 port 3128
rdr on $int_if proto tcp from $lan_net to any port www -> 192.168.0.1 port 3128
# pass all outgoing packets on internal interface
pass out on $int_if from any to $lan_net
# pass in quick any packets destined for the gateway itself
pass in quick on $int_if from $lan_net to $int_if
# load balance outgoing tcp traffic from internal network.
pass in on $int_if route-to \
{ ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin \
proto tcp from $lan_net to any flags S/SA modulate state
#ftp
#nat-anchor "ftp-proxy/*"
#nat on $ext_if1 inet from $int_if -> ($ext_if1)
#rdr-anchor "ftp-proxy/*"
#pass in on $ext_if inet proto tcp to any port 21 \
# flags S/SA keep state
#pass out on $int_if inet proto tcp to any port 21 \
# user proxy flags S/SA keep state
#anchor "ftp-proxy/*"
# load balance outgoing udp and icmp traffic from internal network
#pass in on $int_if route-to { ($ext_if1 $ext_gw1), ($ext_if2 $ext_gw2) } round-robin proto { udp, icmp } from $lan_net to any keep state
# general "pass out" rules for external interfaces
pass out on $ext_if1 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if1 proto { udp, icmp } from any to any keep state
pass out on $ext_if2 proto tcp from any to any flags S/SA modulate state
pass out on $ext_if2 proto { udp, icmp } from any to any keep state
squid coss freebsd 7.1 bagian 3
nakuragen, 30.8.09
Subscribe to:
Post Comments (Atom)


Comments :
Post a Comment