4

On Ubuntu server 14.04, I enabled ufw port forwarding from 80 to 8181 (tcp) by using the checked answer on Can I use ufw to setup a port forward?

Finally I'd rather proxy http request using apache2 proxy capabilities. So I removed the added lines to /etc/ufw/before.rules, then disabled/reenabled ufw.

And the port forwarding is still active. Any idea ?

Thanks in advance.

EDIT

A simple reboot is enough. My guess is that it cleared iptables. So my question is now : how could I have this done without rebooting ?

1 Answers1

2

By flushing the chains in the NAT table and removing any sub-chains:

ufw disable
iptables  --table nat  --flush
iptables  --table nat  --delete-chain
ufw enable

Short options: --table|-t, --delete-chain|-X

  • This did not work for me, I had same problem. After doing the above and robooting things started working for me, not sure if it was a combo of the two or if a reboot alone would have fixed. BTW ubuntu 22.04, same problem. – Mainguy Mar 25 '24 at 22:22