21.9.18

Linux port/host forwarding

https://www.linuxquestions.org/questions/linux-networking-3/iptables-forward-port-to-another-host-844467/

iptables -t nat -A PREROUTING -p tcp -d $from_host --dport $from_port -j DNAT --to $to_host:$to_port
iptables -A FORWARD -d $to_host -p tcp --dport $to_port -j ACCEPT
iptables -t nat -A POSTROUTING -j MASQUERADE
sysctl net.ipv4.ip_forward=1

Cap comentari:

Publica un comentari

Escriu