看板FreeBSD
标 题Re: [请益] 关於natd & firewall
发信站呼啦贝尔 BBS (Thu Nov 27 17:14:26 2008)
转信站ptt!news.ntu!ctu-gate!news.nctu!newsfeed.nthu!news.nthu!bbs.fitbear
※ 引述《[email protected] (Xiao Jin)》之铭言:
> 你真是一个很可爱的学姊啦~~
> 不好意思再问一个...指令这样下好吗?
> ================ this is my /etc/rc.firewall shell script ========
> /sbin/ipfw add deny all from 192.168.0.1 to any
> /sbin/ipfw add deny all from 192.168.0.2 to any
> .
> .
> /sbin/ipfw add deny all from 192.168.0.253 to any #254是我的gateway
> ================this is my /etc/rc.firewall shell script ========
> ※ 引述《[email protected] (我是很可爱的学姊啦~~)》之铭言:
> > 有两个方法
> > 1.把内部网域独立出来,里面不要有其他电脑(不同的switch/VLAN) <== 钱多的建议方案
> > 可以连NAT的电脑---Switch A--(网卡A)NAT Server(网卡B)---Switch B---外部网域
> > (不想让他连NAT的电脑)
> > 2.用ipfw把没有在用的内部ip都挡住
可以简化一下改为这样
注意下指令的顺序喔,不指定优先顺序下越前面下的指令越优先
ipfw add allow all from 192.168.0.XXX to any #允许你想要允许连NAT的电脑
ipfw add allow all from 192.168.0.254 to any #允许你的gateway
ipfw add deny all from 192.168.0.0/24 to any #ban掉其他人
ipfw add divert natd all from any to any via XXX #NAT的指令
--
※ Origin: 呼啦贝尔 <hulabear.twbbs.org>
※ From : ec08.csie.ntu.edu.tw