!#/bin/sh
host_ip=
dst_ip=
host_port=
dst_port=
echo "1">/proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -d $host_ip -p tcp –dport $host_port -j DNAT –to-dest $dst_ip:$dst_port
iptables -t nat -A POSTROUTING -d $dst_ip -p tcp –dport $dst_port -j SNAT –to-source $host_ip
阅读(444) | 评论(0) | 转发(0) |