i need port forwading i have installed linux debian 9 and vpn server pptp
i need forward port 8270 to 192.168.254.2:8270 how to ?

i try with this butnot working

sysctl net.ipv4.ip_forward = 1
iptables -A PREROUTING -t nat -i eth0 -p tcp –dport 8270 -j DNAT –to-destination 192.168.245.1:8270
iptables -A FORWARD -p tcp -d 192.168.245.2 –dport 8270 -j ACEPTA
iptables -A POSTROUTING -t nat -s 192.168.245.2 -o eth0 -j MASQUERADE

intente de esta otra manera:

sysctl net.ipv4.ip_forward = 1
iptables -t nat -A PREROUTING -p tcp –dport 8270 -j DNAT –to-destination 192.168.245.2:8270
iptables -t nat -A POSTROUTING -j MASQUERADE

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!