Skip to content

Instantly share code, notes, and snippets.

@rostyslav
Created June 16, 2011 17:07
Show Gist options
  • Save rostyslav/1029704 to your computer and use it in GitHub Desktop.
Save rostyslav/1029704 to your computer and use it in GitHub Desktop.
Firewall start script
#!/bin/bash
iptables -I INPUT -i lo -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A INPUT -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment