为什么IPFW+NATD 的port map不行?
时间:2004-04-05
来源:互联网
网关服务器是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
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
作者: tntnt 发布时间: 2004-04-05
下面是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的映射。
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的映射。
作者: Eg_zm 发布时间: 2004-04-06
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28