Skip to content

Instantly share code, notes, and snippets.

@thesaadarshad
Created March 28, 2018 08:23
Show Gist options
  • Save thesaadarshad/6aa99709068b286e40334893d22ae7cf to your computer and use it in GitHub Desktop.
Save thesaadarshad/6aa99709068b286e40334893d22ae7cf to your computer and use it in GitHub Desktop.
bootstrap iptable rules
#!/bin/bash
#!/bin/bash
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F -t nat
iptables -F -t mangle
iptables -F
iptables -A INPUT -s 192.186.1.1 -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -s 192.186.1.1 -p tcp -m tcp --dport 5000 -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables-save > /etc/iptables/rules.v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment