afwall icon indicating copy to clipboard operation
afwall copied to clipboard

[ISSUE] Forwarding port 8080 to 80 in custom rules ?

Open freebrowser1 opened this issue 4 years ago • 0 comments

Question: How can I set a custom rule to forward port 8080 to port 80 ?

I have Termux webserver (Apache) running as standard, because 80 (and 443) require root to bind ports < 1024. That does work, butrunning a webserver as root is insecure, so I stick to 8080.

I found a script on askubuntu (which also runs iptables) :

[URL unfurl="true"]https://askubuntu.com/questions/444729/redirect-port-80-to-8080-and-make-it-work-on-local-machine[/URL]

And I filled in this in the custom script field of AFWall+< but it does not work (port 80 is not open, unlike when I start Apache as root (insecure).).

IPTABLES=/system/bin/iptables

$IPTABLES -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

I have read the documentation, so what am I doing wrong ?

freebrowser1 avatar Apr 19 '21 10:04 freebrowser1