Skip to content

Instantly share code, notes, and snippets.

@d0x
Last active August 29, 2015 14:16
Show Gist options
  • Save d0x/56054a0e84ab9bddf10b to your computer and use it in GitHub Desktop.
Save d0x/56054a0e84ab9bddf10b to your computer and use it in GitHub Desktop.
Secure MongoDB to access it from own IPAdress using IPTables
#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