Last active
August 29, 2015 14:16
-
-
Save d0x/56054a0e84ab9bddf10b to your computer and use it in GitHub Desktop.
Secure MongoDB to access it from own IPAdress using IPTables
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
#as root | |
apt-get install iptables-persistent -y | |
iptables -F #Clears most IPTables entries | |
iptables -A INPUT -p tcp --dport 27017 -s localhost -j ACCEPT | |
iptables -A INPUT -p tcp --dport 27017 -s 134.3.208.8 -j ACCEPT | |
iptables -A INPUT -p tcp --dport 27017 -j DROP | |
iptables-save > /etc/iptables/rules.v4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment