Closed TrackTech closed 6 years ago
Mongo is running on port 27017 Node is running on 1237
Find my ip address on ubuntu box nmcli dev show "device" nmcli dev give you the device names use device name in above command
Node only listens to 1 host which is specified in the listen function http.createServer(handleRequest).listen(1237,'127.0.0.1')
mongod is bound to only 1 host to listen to connection request /etc/mongod.conf bindip:127.0.01
No firewall rule is need for both mongod and nodejs server as they are configured to listen to only specific hosts.
Write firewall rules E.g sudo iptables -I INPUT -p tcp --dport 8080 ! -s 111.111.111.111 -j REJECT --reject-with tcp-reset
https://serverfault.com/questions/381833/how-can-i-block-port-6379-for-outside-traffic-on-ubuntu