Skip to content

Instantly share code, notes, and snippets.

@droganaida
Last active January 9, 2017 10:05
Show Gist options
  • Select an option

  • Save droganaida/87bc3cc190982fe57ad3bf898e2e1d37 to your computer and use it in GitHub Desktop.

Select an option

Save droganaida/87bc3cc190982fe57ad3bf898e2e1d37 to your computer and use it in GitHub Desktop.
bind_ip = 127.0.0.1
iptables -A INPUT -s 127.0.0.1 -p tcp --dport 27017 -j ACCEPT
iptables -A INPUT -s xxx.xxx.xxx.xxx -p tcp --dport 27017 -j ACCEPT
iptables -A INPUT -s yyy.yyy.yyy.yyy -p tcp --dport 27017 -j ACCEPT
iptables -A INPUT -p tcp --dport 27017 -j DROP
iptables -L -n
sudo apt-get install iptables-persistent
service iptables-persistent save
service iptables-persistent start
iptables -F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment