Skip to content

Instantly share code, notes, and snippets.

@NSLog0
Created January 9, 2017 16:51
Show Gist options
  • Select an option

  • Save NSLog0/fff427dfdb146e7537beb47028b6bdb6 to your computer and use it in GitHub Desktop.

Select an option

Save NSLog0/fff427dfdb146e7537beb47028b6bdb6 to your computer and use it in GitHub Desktop.
// ขั่นแรกตั่ง iptable เพื่อให้เข้าถึงได้จาก IP ที่ต้องการในที่นี่คือ Applcation Server ตามตัวย่าง
$ iptables -A INPUT -s 10.130.29.177 -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
$ iptables -A OUTPUT -d 10.130.29.177 -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
// ถัดมาให้เพิ่มระดับความปลอดภัยไปอีกคือ
$ vim /etc/mongod.conf
bind_ip = 127.0.0.1,10.130.29.177
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment