- 论坛徽章:
- 0
|
![]()
重新编辑了内核
ident IN
device pf
device pflog
device pfsync
Options ALTQ
Options ALTQ_CBQ
Options ALTQ_RED
Options ALTQ_RIO
Options ALTQ_HFSC
Options ATLQ_PRIQ
Options ATLQ_NOPCC
make buildkernel KERNCONF=IN
make installkernel KERNCONF=IN
reboot
PF的设置:
pf.conf
>> 1 ext_if = "lnc1" #外部接口
>> 2 int_if = "lnc0" #内部接口
>> 3 localnet = $int_if:network
>> 4 webserver = "{ 10.10.2.2 }"
>> 5 webport = "{ http, https }"
>> 6
>> 7 block in all
>> 8 block out all
>> 9
>> 10 rdr on $int_if proto tcp from $localnet to $int_if port $webport -> $webserver port $webport
>> 11 pass all
>> 12
>>
>> 这是错误信息:
>>
>> # pfctl -f /etc/pf.conf
>> /etc/pf.conf:10: syntax error
>> pfctl: Syntax error in config file: pf rules not loaded
在这儿,感谢好心人的帮助,谢谢!
问题有几点!
1:block in all 与block out all 就写在 rdr 之后,写在前了,报rules must be in order 规则顺序错!
2:在定义宏时,用$webport = "{ http, https }" 就报错误(syntax error) 我试着用$webport = "{ 80, 443 }" ,也不行!
rar on $int_if proto tcp from $localnet to port 80 -> $webserver port 80
这样就没问题了,定义宏时要小心!
[ 本帖最后由 liudew 于 2009-5-11 15:29 编辑 ] |
|