0

I've got a pretty basic two node mosquitto setup. One of the machines is behind a firewall not accepting incoming connections, but I can send information out. I've not implemented SSL or an ACL yet. Trying to keep this verry simple right now. Anyway, the machine behind the firewall is getting messages from some Pi's then sending it to the local broker. Another local application is connecting to that machine over websockets. I need to have these messages published to another broker outside the firewall.

I'm seeing the firewalled broker connecting to the external one, but I am unable to see any messages. Further more, I need to have the devices behind the firewall continue to receive messages from the local broker.

The following is my bridge config

connection bridge
address hostname-to-external-mqtt
topic both 0 #
bridge_attempt_unsubscribe false
local_clientid local
remote_clientid remote
start_type automatic
try_private false
cleansession true

The following is the verbose output from my the firewalled machine that needs to duplicate the messages on the remote machine

mosquitto -c ./mosquitto.conf -v
1441942973: mosquitto version 1.4.2 (build date 2015-07-02 21:31:17-0400) starting
1441942973: Config loaded from ./mosquitto.conf.
1441942973: Opening ipv4 listen socket on port 1883.
1441942973: Opening ipv6 listen socket on port 1883.
1441942973: Opening websockets listen socket on port 9001.
1441942973: Bridge local doing local SUBSCRIBE on topic NODE-1/
1441942973: Connecting bridge bridge (remotehost:1883)
1441942973: Bridge remote sending CONNECT
1441942973: Received CONNACK on connection local.
1441942973: Bridge local sending SUBSCRIBE (Mid: 2, Topic: NODE-1/, QoS: 0)
1441942973: Received PUBACK from local (Mid: 1)
1441942973: Received SUBACK from local
1441942974: New connection from 192.168.1.18 on port 1883.
1441942974: New client connected from 192.168.1.18 as paho/AE8E0FF0F7A0180A22 (c1, k60).
1441942974: Sending CONNACK to paho/AE8E0FF0F7A0180A22 (0, 0)
1441942974: New connection from 192.168.1.3 on port 1883.
1441942974: New client connected from 192.168.1.3 as paho/9EE5A8894DD7E6EDC3 (c1, k60).
1441942974: Sending CONNACK to paho/9EE5A8894DD7E6EDC3 (0, 0)

And the following is the the verbose output from the remote machine

1441943193: New connection from firewalled-ip on port 1883.
1441943193: New client connected from firewalled-ip as local (c1, k60).
1441943193: Sending CONNACK to local (0, 0)
1441943193: Received PUBLISH from local (d0, q1, r1, m1, '$SYS/broker/connection/local/state', ... (1 bytes))
1441943193: Sending PUBACK to local (Mid: 1)
1441943194: Received SUBSCRIBE from local
1441943194:     NODE-1/ (QoS 0)
1441943194: local 0 NODE-1/
1441943194: Sending SUBACK to local

Can anyone help point me in the right direction please?

user3780616
  • 1,183
  • 1
  • 10
  • 23

1 Answers1

0

It doesn't look like the config you posted and the logs match.

Config states:

topic both 0 #

Yet the log shows:

1441943194: Received SUBSCRIBE from local
1441943194:     NODE-1/ (QoS 0)

It should be subscribing to # instead of NODE-1/.

Could you check that you are using the config that you think?

ralight
  • 11,033
  • 3
  • 49
  • 59