echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -A PREROUTING -d 219.150.150.11 -j DNAT --to-destination 192.168.5.11
iptables -t nat -A POSTROUTING -d 192.168.5.11 -j SNAT --to 192.168.0.1
iptables -t nat -A PREROUTING -d 219.150.150.11 -p tcp --dport 80 -j DNAT --to-destination 192.168.5.11
iptables -t nat -A POSTROUTING -d 192.168.5.11 -j SNAT --to 192.168.0.1
iptables -t nat -A PREROUTING -d 219.150.150.11 -p udp --dport 53 -j DNAT --to-destination 192.168.5.11:161
iptables -t nat -A POSTROUTING -d 192.168.5.11 -j SNAT --to 192.168.0.1
阅读(1007) | 评论(0) | 转发(1) |