Created
December 23, 2017 15:09
-
-
Save v0y4g3r/0d7dc3614de80611cde0a2c94789d0e6 to your computer and use it in GitHub Desktop.
iptables-rules
This file contains 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
sudo iptables -A INPUT -i lo -j ACCEPT | |
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A INPUT -m conntrack --ctstate INVALID -j DROP | |
sudo iptables -A INPUT -p tcp --dport {SSHD_PORT} -s 219.223.0.0/16 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport {SSHD_PORT} -j REJECT --reject-with icmp-host-unreachable | |
sudo iptables -A INPUT -j REJECT --reject-with icmp-host-unreachable | |
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment