Chinaunix

标题: 有个OpenBSD4.0 的pf NAT问题不好解决! [打印本页]

作者: zb77510    时间: 2006-12-21 22:53
标题: 有个OpenBSD4.0 的pf NAT问题不好解决!
请问如果用下面的这个代码代理客户机上网!


ext_if="fxp1"
int_if="fxp0"


udp_server="{53,22}"


nat on fxp1 from 192.168.1.0/24 to any ->51.143.182.38
pass out on $ext_if proto udp from any to any port $udp_server keep state

block drop out quick on fxp0 from 192.168.1.17 to any
block drop out quick on fxp0 from 192.168.1.21 to any
block drop out quick on fxp0 from 192.168.1.10 to any

这样是否可以禁用17  21 10这三台IP地址的主机上网!!!


感觉用IPFW实现非常好写!

如果不重新启动机器,是否可以使用#pfctl -f /etc/pf.conf
来重新载入pf.conf编写好的规则!

[ 本帖最后由 zb77510 于 2006-12-21 22:55 编辑 ]
作者: qq830406    时间: 2006-12-21 23:17
pfctl -f /etc/pf.conf重新载入可以
作者: congli    时间: 2006-12-22 08:20
规则重新载入,最好用-F把相应的清除一下或者-F all全部清除.
man pfctl more for help.
作者: zb77510    时间: 2006-12-22 10:47
重新载入规则

#pfctl -Rf  /etc/pf.conf
查看当前规则:
#pfctl -sr


对于不然局域网内革个IP地址上网,方法是有了!不过,想找找有没有更好的!


谢谢楼上两位!
作者: congli    时间: 2006-12-22 11:08
     -R      Load only the filter rules present in the rule file.  Other rules
             and options are ignored.





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2