Skip to content

Instantly share code, notes, and snippets.

@luanvuhlu
Created June 8, 2017 08:06
Show Gist options
  • Save luanvuhlu/4c63d6251dac313c1ccaaf2001a38cea to your computer and use it in GitHub Desktop.
Save luanvuhlu/4c63d6251dac313c1ccaaf2001a38cea to your computer and use it in GitHub Desktop.
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
iptables -L -n
iptables-save | sudo tee /etc/sysconfig/iptables
service iptables restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment