docker iptables 端口映射 nat
#!/bin/bash
pro='tcp'
NAT_Host='Host_A'
NAT_Port=8080
Dst_Host='Host_B'
Dst_Port=80
iptables -t nat -A PREROUTING -m $pro -p $pro --dport $NAT_Port -j DNAT --to-destination $Dst_Host:$Dst_Port
iptables -t nat -A POSTROUTING -m $pro -p $pro --dport $Dst_Port -d $Dst_Host -j SNAT --to-source $NAT_Host
参考:
http://www.opstool.com/article/206