
pf.conf:
Код: Выделить всё
ext_if="tun0"
extif1="tun0"
extif2="tun1"
extif3="tun2"
int_if="vr0"
int_net="192.168.0.0/3"
TCP="proto tcp"
UDP="proto udp"
UTP="proto { tcp, udp }"
UIP="proto { udp, icmp }"
KSF="keep state"
MSF="modulate state"
SSA="flags S/SA"
ports_games="{ 22, 23, 3724, 5190, 6667 }"
# hosts must be in DNS !!!
philka= "192.168.0.2"
table <gods> persist { \
philka \
}
table <users> persist { \
philka \
}
set block-polic
set state-policy if-boundy return
set state-policy if-bound
scrub in all random-id #no-df
scrub on tun reassemble tcp
altq on $int_if bandwidth 100Mb qlimit 150 cbq queue { \
int_dflt, int_ack, int_games, int_gods, int_clients }
queue int_dflt bandwidth 100Mb priority 4 cbq(default borrow)
queue int_ack bandwidth 512Kb priority 5 cbq(ecn)
queue int_games bandwidth 384Kb priority 6 cbq(ecn)
queue int_gods bandwidth 3800Kb priority 3 cbq(ecn red borrow)nat on $ext_if from <gods> to ! $int_net -> ($ext_if) port 30000:49999
nat on $ext_if from <clients> to ! $int_net -> ($ext_if) port 50000:60000
nat on $ext_if from $int_net to ! $int_net -> ($ext_if)
rdr pass on $ext_if proto tcp from any to any port 60003 -> 192.168.0.3rdr pass on $ext_if proto tcp from any to any port 60003 -> 192.168.0.3
pass on lo all $KSF label Loopback
pass on $int_if to $int_if $KSF label LAN queue (int_clients, int_ack)
pass in on $int_if from <gods> to ! $int_net $KSF \
label Gods-In tag gods queue (int_gods, int_ack)
pass in on $int_if $UTP from <users> to ! $int_net port $ports_games $KSF \
label Games-In tag games queue (int_games)
pass out on tun $KSF \
label Clients-Out tagged clients queue (int_clients, int_ack)
pass out on tun $KSF \
label Gods-Out tagged gods queue (int_gods, int_ack)
pass out on tun $KSF \
label Games tagged games queue (int_games)
pass out on tun all i
block in on $int_if from ! <users> label Outlaw
Код: Выделить всё
ifconfig_vr0="inet 192.168.0.1 netmask 255.255.255.0"
gateway_enable="YES"
natd_enable="YES"
natd_interface="vr0"
natd_flags=""
default_gateway="192.168.0.1"
routing_enable="YES"