I am trying to implement MQTT protocol using RabbitMQ. I have installed RabbitMQ server and changed the MQTT port from 1883 to 80.I am able to publish and subscribe to the server from the network. But when I try to publish or subscribe using external ip, I am getting "timed out" error. Can anyone please share how to publish or subscribe using external ip?
1 Answers
It's not really clear from the question what your network topology is, but I will take a guess.
You are running your MQTT broker on a machine connected to a private ip range (e.g. 192.168.*), you can connect to this machine from another machine on the same network.
You are now trying to connect from a machine outside this network. Your private ip range network is behind a router doing NAT. You will need to enable port forwarding on the router to send all traffic on your required port (in this case port 80) to the broker machine. How you do this will depend on your router.
EDIT: Given the new information then there are 2 possible options:
Your instance of RabbitMQ is only binding to your private IP address, have a look in the rabittmq.conf file for an entry starting with
RABBITMQ_NODE_IP_ADDRESS=
. If you have one comment it out so rabbitmq will default to binding to all addresses. More details can be found here: https://www.rabbitmq.com/configure.htmlYou have a firewall enabled on your machine that is silently dropping all traffic to port 80 on the public IP address. I suggest it's silently dropping traffic because you are seeing a timeout not a connection refused message. You haven't said what OS you are using so I can't make suggestions about how to change your firewall rules

- 54,545
- 11
- 67
- 105
-
Thanks for your reply. MQTT broker running on a system is enabled with private IP and also Public IP. I am able to access the broker with in the network using private IP. When I try accessing with public IP from outside network, I am getting timed out error. – Avinash Dec 06 '15 at 04:15