作者rightflow (交大再见,毕业了...)
看板FreeBSD
标题[问题] ipfw 与 nat 外部ip 重导的问题
时间Thu Jan 31 11:17:34 2008
有两张网卡 fxp0 与 fxp1 ; fxp0 是外部IP(假设为 10.0.0.1) ; fxp1 为内部 ip( 假设为 192.168.0.254 ) ;
目前遇到的问题是 从内部 ip telnet 10.0.0.1 25 转不进来
但是从 外面其他的 ip telnet 10.0.0.1 25 是 ok 可以work 的...
搞了很久不知道错在哪里,想请各位高手帮忙一下,
谢谢!
我列出 相关设定
/etc/rc.conf
firewall_enable="YES" # Set to YES to enable firewall functionality
firewall_script="/usr/local/sbin/firewall.sh" # Which script to run to set up the firewall
firewall_type="OPEN" # Firewall type (see /etc/rc.firewall)
firewall_quiet="NO" # Set to YES to suppress rule display
firewall_logging="NO" # Set to YES to enable events logging
firewall_flags="" # Flags passed to ipfw when type is a file
gateway_enable="YES" # Set to YES if this host will be a gateway.
natd_enable="YES" # Enable natd (if firewall_enable == YES).
natd_program="/sbin/natd" # path to natd, if you want a different one.
natd_interface="fxp0" # Public interface or IPaddress to use.
natd_flags="-f /etc/natd.conf" # config file at /etc/natd.conf
/etc/natd.conf
redirect_port tcp 192.168.0.5:25 10.0.0.1:25
/usr/local/sbin/firwall.sh
# nat
${fwcmd} add 1020 divert natd ip from any to 10.0.0.1 via fxp0
${fwcmd} add 1040 divert natd ip from 192.168.0.0/16 to any
${fwcmd} add 30030 pass ip from 10.0.0.1 to any keep-state
${fwcmd} add 30030 pass ip from 192.168.0.0/16 to any keep-state
${fwcmd} allow tcp from any to me 25
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.113.27.50