看板FreeBSD
标 题Re: MSN的PORT
发信站交大资科_BBS (Thu Jul 8 11:12:18 2004)
转信站ptt!ctu-reader!ctu-peer!news.nctu!news.cis.nctu!cis_nctu
==> 在 [email protected] (要买车车ㄌ !^.^! 的文章中提到:
> ※ 引述《[email protected] (虫)》之铭言:
> > 没有固定哪个port, 只能用UPnP功能去解决.
> > /usr/ports/net/linuxigd
> > linuxigd不会控制ipfw, 所以NAT转址方式, ipfw+natd方式不能用,
> > 得用ipfilter的ipnat.
> ~~~~~~~~~~~~~~~~
> 有教学吗??
分享一些简单的个人经验
## kernel config ##
options IPFILTER
#ipfilter support
options IPFILTER_LOG
#ipfilter logging
## /etc/rc.conf ##
gateway_enable="YES"
ipfilter_enable="YES"
ipnat_enable="YES"
## /etc/ipf.rules ##
block in proto icmp from any to any icmp-type echo
block in proto tcp from any to <public ip>/32 port = 22
pass in proto tcp from <some network>/24 to <public ip>/32 port = 22
## /etc/ipnat.rules ##
map xl0 <private network>/24 -> <public ip>/32 portmap tcp 10000:60000
map xl0 <private network>/24 -> <public ip>/32
rdr xl0 <public ip>/32 port 3389 -> <private ip> port 3389 tcp
--
* Post by RunBird from dcspc16.cis.nctu.edu.tw
* Origin: ★ 交通大学资讯科学系 BBS ★ <bbs.cis.nctu.edu.tw: 140.113.23.3>