如何使用NAT( 二 )


d) 重新开机
e) 执行 natd
natd -interface ed0
其中 ed0 是你连上网路的媒介,例如 ed0 ppp0 de0 tun0,这样封包会经由该媒介转送 。
f) 执行 ipfw (把 ed0 换成 natd 用的那个)
/sbin/ipfw add 60000 divert 6668 all from any to any via ed0

3. 到此大致完成了,你可以把你的 clients 的 router IP 设到这台 FreeBSD Server,测试看看能不能上网路 。

4. 如果成功了,可以把 ipfw 那行加到 /etc/rc.firewall 中,把 natd 那行加到 /etc/rc.local 中,这样以後就可以自动启动了 。

5. 这只是最基本的设定,natd 还有许多特异功能,请自行 man natd 。

推荐阅读