LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 810|回复: 1

为什么IPFW+NATD 的port map不行?

[复制链接]
发表于 2004-4-5 09:22:42 | 显示全部楼层 |阅读模式
网关服务器是FreeBSD 4.9+IPFW+NATD,想port map一台内网的POP3服务器,以便在外网收内网的信件.具体配置如下:
192.168.0.10 ==>内网的POP3服务器
61.172.13.113 ==>网关外网网卡IP

/etc/rc.conf(关于IPFW+NATD部分):
gateway_enable="YES"
firewall_enable="YES"
firewall_script="/etc/rc.firewall"
firewall_type="open"
firewall_quiet="YES"
firewall_logging_enable="YES"
natd_enable="YES"
natd_interface="fxp1"
natd_flags="-f /etc/natd.conf"

/etc/natd.conf
log yes
redirect_port tcp 192.168.0.10:110 61.172.13.113:110

#ipfw show
00050 28022 20855525 divert 8668 ip from any to any via fxp1
00100 0 0 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 54858 41581092 allow ip from any to any
65535 0 0 allow ip from any to any

请问这样的配置有错误吗?为什么不能够做port map,telnet 61.172.13.113:110 提示无法连接服务器?

PS:内核部分(IPFW):
options IPFIREWALL
options IPDIVERT
options IPFIREWALL_FORWARD
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=100
options IPSTEALTH
options ICMP_BANDLIM
options IPFIREWALL_DEFAULT_TO_ACCEPT
发表于 2004-4-6 13:37:18 | 显示全部楼层

对ipfw不了解

下面是ipfilter的规则,你可以参照看看:
rl0:外,202.202.202.202
rl1:内,192.168.0.1
pop3:192.168.0.3
####ipf.rules
pass in quick on rl0 all keep state
pass in quick on rl1 all keep state
pass out quick on rl0 all keep state
pass out quick on rl1 all keep state
######ipnat.rules
map rl0 192.168.0.0/24 -> 202.202.202.202 proxy port ftp ftp/tcp
map rl0 192.168.0.0/24 -> 202.202.202.202 portmap tcp/udp 10000:65000
map rl0 192.168.0.0/24 -> 202.202.202.202
rdr rl0 202.202.202.202 port 110 -> 192.168.0.3 port 110
\########
其中的规则过滤,我没有添加多,只是下面的
rdr rl0 202.202.202.202 port 110 -> 192.168.0.3 port 110
一行,实现对pop3的映射。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表