作者starlition ()
看板FreeBSD
标题Re: [问题] NAT Port Forwarding有错误
时间Sat Mar 15 00:09:30 2008
※ 引述《[email protected] (FreeBSD伤脑中)》之铭言:
: ※ 引述《[email protected] (可爱茶)》之铭言:
: > 题外话.. 我建议使用 pf .. 可以作的事更多..
: > 如果是使用 pf 的话.. config 如下..
: > # 原本的 NAT
: > nat on de0 from 192.168.112.0/24 to any -> 140.115.208.168/32
: > # Portmapping
: > rdr on de0 proto tcp from any to 140.115.208.168/32 port 3389 -> (接下面)
: > 192.168.112.168 port 3389
: 别忘了(以下执行权限为 root)
: %> echo "gateway_enable=\"YES\"" >> /etc/rc.conf
: %> kldload pf
: 启动 pf
: 1. %> /etc/rc.d/pf start
: 2. %> pfctl -e
: 关闭 pf
: 1. %> /etc/rc.d/pf stop
: 2. %> pfctl -d
: 如果 /etc/rc.d/pf restart 会让远端连线断线
: 可以试试
: %> pfctl -de
: reference
: http://www.openbsd.org/faq/pf/nat.html
: http://cavanantha.wordpress.com/2007/09/16/nat-on-freebsd-using-pf/
我自己用pf都是
pfctl -f xxx.conf
就会使用新的设定了
不需要 pfctl -d ; pfctl -e
提供给大家参考
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 219.80.34.170