Opening a port on Ubuntu
问题 I am trying to open up port on my Ubuntu machine to allow me to connect the Mongo using an external program. I ran this which is the command line to open a new port: sudo iptables -A INPUT -p tcp --dport 27017 -j ACCEPT but when I ran this to check if the new rule was there... sudo netstat -ntlp | grep LISTEN ...the new port wasn't in the list - any ideas? 回答1: I think the mangodb instance was not started, apart from that , sudo netstat -ntlp | grep LISTEN gives the list ports that are active