Страница 1 из 1

Настройка PF

Добавлено: 2012-04-09 16:12:28
sn0wer
pfconf

Код: Выделить всё

ext_if="igb0"
int_if="igb1"
set skip on lo0
scrub in all
nat on $ext_if from $int_if:network to any -> ($ext_if)
block all
pass in on $int_if from any to any
pass out on $ext_if from $ext_if to any
pass in on $ext_if proto tcp from any to $ext_if port ssh
pass in on $ext_if proto tcp from any to $ext_if port 80
#pass in on $ext_if proto tcp from any to $ext_if port 81 rdr-to 192.168.1.108 port 80
#pass in on $ext_if proto tcp from any to $ext_if port 37777 rdr-to 192.168.1.108 port 37777
#pass in on $ext_if proto udp from any to $ext_if port 37778 rdr-to 192.168.1.108 port 37778
pass in inet proto icmp all icmp-type echoreq 
Когда раскоменчиваю строчки все ложится. Где я наступил на грабли?

Re: Настройка PF

Добавлено: 2012-04-10 9:44:48
sn0wer

Код: Выделить всё

ext_if="igb0"		
int_if="igb1" 			
set skip on lo0
scrub in all 
nat on $ext_if from $int_if:network to any -> ($ext_if)
rdr on $ext_if proto tcp from any to any port 82 -> 192.168.1.108 port 80
rdr on $ext_if proto tcp from any to any port 37777 -> 192.168.1.108 port 37777
rdr on $ext_if proto udp from any to any port 37778 -> 192.168.1.108 port 37778
block all
pass in on $int_if from any to any 
pass out on $ext_if from $ext_if to any
pass out on $int_if inet proto tcp from any to 192.168.1.108 port 80 keep state
pass out on $int_if inet proto tcp from any to 192.168.1.108 port 37777
pass out on $int_if inet proto udp from any to 192.168.1.108 port 37778
pass in on $ext_if proto tcp from any to $ext_if port ssh
pass in on $ext_if proto tcp from any to $ext_if port 80
pass in on $ext_if proto tcp from any to $ext_if port 82
pass in on $ext_if proto tcp from any to 192.168.1.108 port 80 synproxy state
pass in on $ext_if proto tcp from any to 192.168.1.108 port 37777 synproxy state
pass in on $ext_if proto tcp from any to 192.168.1.108 port 37778 synproxy state 
pass in on $ext_if proto tcp from any to $ext_if port 37777
pass in on $ext_if proto udp from any to $ext_if port 37778
pass in inet proto icmp all icmp-type echoreq
так решил