iptables -A INPUT -p tcp -m multiport --dports 80,443,8080,8181 -m state --state NEW -m limit --limit 50/minute --limit-burst 200 -j ACCEPT iptables -A INPUT -p tcp -m multiport --dports 80,443,8080,8181 -m state --state ESTABLISHED,RELATED -m limit --limit 50/second --limit-burst 50 -j ACCEPT iptables -A PREROUTING -t nat -p tcp --dport 80 -j DNAT --to-destination :8080 iptables -A PREROUTING -t nat -p tcp --dport 443 -j DNAT --to-destination :8181 iptables -A FORWARD -p tcp -m multiport --dports 8080,8181 -j ACCEPT
I am trying to redirect traffic on 80 to 8080 and 443 to 8181. This was succesful by using preceding lines. Now I am trying to restrict access to 8080 and 8181 directly, though I am not sure how.
I know there are some questions concerning this issue, though I haven't found any solution. Despite the accepted answer in this question, I know this should be possible by just using iptables.
Any help would be appreciated.