[FreeBSD]
FreeBSD的ipfw+natd端口映射到内网交换机的提问!
在外地托管了一台服务器,服务器分配了1个静态的IP如:61.222.125.22,服务器上接在一台用于控制流量的交换机,交换机分配了1个内网的IP如:10.50.50.50,这台交换机在内网上可以通过http://10.50.50.50的web的80端口界面来进入管理网络流量的,我现在想通过61.222.125.22这个地址通过NAT的映射到内网的10.50.50.50的交换机上直接在IE上管理这台交换机.
我的防火墙配置文件内容如下:
add 00400 divert natd ip from any to any via fxp0
add 13000 allow tcp from any to any 22
add 13002 allow tcp from any to any 80
add 19997 check-state
add 19998 allow tcp from any to any out keep-state setup
add 19999 allow tcp from any to any out
add 20001 allow udp from any 53 to me
add 20002 allow udp from me to any 53
add 65000 deny all from any to any
======================================
我的natd.conf配置文件内容如下:
log yes
redirect_port tcp 10.50.50.50:80 61.222.125.22:80
=======================================
我的rc.conf配置文件内容如下注明:服务器只有一张网卡)
defaultrouter="61.222.125.222"
gateway_enable="YES"
hostname="admin.com"
ifconfig_fxp0="inet 61.222.125.22 netmask 255.255.255.224"
ifconfig_fxp0_alias0="inet 10.50.50.20 netmask 255.255.255.0"#我已经绑定了和内网交换机的网卡IP同一网段的.
inetd_enable="NO"
linux_enable="YES"
sshd_enable="YES"
firewall_enable="YES"
firewall_type="/etc/ipfw.conf"
firewall_quiet="NO"
firewall_loggin_enable="YES"
natd_interface="fxp0"
natd_enable="YES"
natd_flags="-config /etc/natd.conf"
=========================================
另外注明:我通过以上方法可以正常把服务器的61.222.125.22的IP映射到其它的网站上的,而且是正常工作的,例如我把我的natd.conf配置成如下是正常的运作
我的natd.conf配置文件内容改成映射到其它网站例如配置成如下内容:
log yes
redirect_port tcp 212.154.225.11:80 61.222.125.22:80
就是不知道为什么要映射到我的交换机上的10.50.50.50这个IP的80端口就是访问不了,那位有好的办法请指教,谢谢!