Created
July 22, 2018 07:46
-
-
Save Martin91/c59ce0019703f9f076cfd70185f63ac5 to your computer and use it in GitHub Desktop.
iptables to allow only localhost to access specified port
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
# Allow access only localhost by port 1991 | |
sudo iptables -A INPUT -i lo -p tcp --dport 1991 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 1991 -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment