dev-vm/scripts/forwardports.sh

11 lines
253 B
Bash
Raw Normal View History

2021-04-07 09:49:14 +02:00
#!/bin/sh
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -X
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.56.11:80
iptables -t nat -A POSTROUTING -p tcp -d 192.168.56.11 --dport 80 -j MASQUERADE