Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
Last active August 29, 2015 13:56
Show Gist options
  • Save vicendominguez/8978478 to your computer and use it in GitHub Desktop.
Save vicendominguez/8978478 to your computer and use it in GitHub Desktop.
Firewall rules to redirect Glassfish 4.0 ports (80,443,8080 and 8181 will be open to internet)
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
iptables -A INPUT -p tcp --dport 8181 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8181
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment