20200817 Linux-iptables端口转发

20200817 Linux-iptables端口转发

八月 17, 2020

20200817 Linux-iptables端口转发

iptables 转发端口
Centos6 10.10.10.4
KaliLinux 10.10.10.9

1
2
3
4
5
6
7
8
9
sysctl -w net.ipv4.ip_forward=1

iptables -t nat -A PREROUTING -p tcp --dport 2333 -j DNAT --to-destination 10.10.10.9:80

iptables -t nat -A POSTROUTING -p tcp -d 10.10.10.9 --dport 80 -j SNAT --to-source 10.10.10.4

service iptables save

service iptables restart

image.png