iptables port forwarding

https://www.v2ex.com/t/213227
http://www.361way.com/iptables-udp-nat/2947.html
http://www.latelee.org/using-gnu-linux/iptables-notes-tcp-udp-forward.html



iptables -t nat -A PREROUTING -p udp --dport <port> -j DNAT --to-destination <dst:ip:port>
iptables -t nat -A POSTROUTING -p udp -d <dst ip> --dport <port> -j SNAT --to-source <src ip>
iptables -A FORWARD -d <src ip> -p udp --dport <port> -j ACCEPT

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326330976&siteId=291194637