DEV Community

Anderson Ribeiro
Anderson Ribeiro

Posted on

Forwarding port 3000 to 80 on ubuntu.

sudo iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -i eth0 -p tcp --dport 3000 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
Enter fullscreen mode Exit fullscreen mode

That works.

Top comments (0)