Skip to content

Instantly share code, notes, and snippets.

@sonuame
Last active August 16, 2020 11:18
Show Gist options
  • Save sonuame/42a68a85c60315b52204d0dfd98102de to your computer and use it in GitHub Desktop.
Save sonuame/42a68a85c60315b52204d0dfd98102de to your computer and use it in GitHub Desktop.
sudo apt-get install iptables-persistent
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1433 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9000 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo netfilter-persistent save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment