Created
March 28, 2018 08:23
-
-
Save thesaadarshad/6aa99709068b286e40334893d22ae7cf to your computer and use it in GitHub Desktop.
bootstrap iptable rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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