Created
September 23, 2016 10:12
-
-
Save pioz/88943cd9917c46b91ad3f8a7ea345b30 to your computer and use it in GitHub Desktop.
Drop a range of ports except for localhost
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
| iptables -A INPUT -p tcp --match multiport --dports 3000:6000 -s 127.0.0.1 -j ACCEPT | |
| iptables -A INPUT -p tcp --match multiport --dports 3000:6000 -j DROP | |
| # to remove this rules | |
| iptables -D INPUT -p tcp --match multiport --dports 3000:6000 -s 127.0.0.1 -j ACCEPT | |
| iptables -D INPUT -p tcp --match multiport --dports 3000:6000 -j DROP | |
| # Use iptables-persist to make this rules persistant |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment