关天路由静态IP地址转换问题?

由 yujian715 在 04-24-2003 10:38 发表:

关天路由静态IP地址转换问题?

最近我想将我们内部IP的一台电脑转换成外部公网IP(内部IP为172.21.1.9 转换成 218.5.238.9)可没有成功!请问有哪位高手帮我解决一下?

iptables -t nat -A POSTROUTING -s 172.21.1.9 -j SNAT --to 218.5.238.9

iptables -t nat -A PREROUTING -d 218.5.238.9 -j DNAT --to 172.21.1.9

iptables -t nat -A POSTROUTING -s 172.21.1.9 -j RETURN

iptables -t nat -A POSTROUTING -d 172.21.1.9 -j RETURN

iptables -t nat -A POSTROUTING -j MASQUERADE

iptables -F

iptables -A OUTPUT -p icmp --icmp-type host-redirect -j DROP

ipta

Published At
Categories with 服务器类
Tagged with
comments powered by Disqus