Package Filter (1)
2009-05-13 00:51:21来源:未知 阅读 ()
1, 打开转发功能, 编辑/etc/sysctl.conf, 将net.inet.ip.forwarding=1前面的注释符号 # 去掉。
2, 编辑/etc/rc.conf, 打开PF, pf=YES。
3, 编辑/etc/pf.conf, 设置规则链。我的pf.conf规则链还没设置好, 这里就先贴我现在写的pf.conf, 私网中的机器已可以上网了。
Gate-OpenBSD# cat pf.conf
# $OpenBSD: pf.conf,v 1.28 2004/04/29 21:03:09 frantzen Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Remember to set net.inet.ip.forwarding=1 and/or net.inet6.ip6.forwarding=1
# in /etc/sysctl.conf if packets are to be forwarded between interfaces.
ext_if="ne3"
int_if="dc0"
tcp_services="{21, 22, 53, 67, 68, 80, 113, 443}"
udp_services="{22, 53, 68}"
icmp_types="echoreq"
lan_net="192.168.1.0/24"
scrub in all
nat on $ext_if from !($ext_if) to any -> ($ext_if:0)
block log all
pass quick on lo0 all
antispoof for { lo $int_if $ext_if } inet
pass in on $ext_if inet proto tcp from any to $ext_if port ssh flags S/SA keep state
pass in on $int_if inet proto tcp from $lan_net to $int_if port ssh flags S/SA keep state
pass in on $int_if from $lan_net to any
pass out on $int_if from any to $lan_net
pass out on $ext_if proto tcp from any to any port $tcp_services keep state
pass out on $ext_if proto udp from any to any port $udp_services keep state
pass in on $int_if proto tcp from any to any port $tcp_services keep state
pass in on $int_if proto udp from any to any port $udp_services keep state
pass in inet proto icmp all icmp-type $icmp_types keep state
pass out inet proto icmp all icmp-type $icmp_types keep state
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/5624/showart_18720.html
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- Freebsd oracle 10g 2009-05-13
- KDE/FreeBSD 测试 QT-4.5.1. 2009-05-13
- OpenBSD 4.5下安装Gnome 2.24成功! 2009-05-13
- OpenBSD 4.5 2009-05-13
- DragonFly BSD 2.2.1发布 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash