Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Why is this mosquitto broker inaccessible to remote machines? ("Error: No connection could be made because the target machine actively refused it.")
Why is this mosquitto broker inaccessible to remote machines? [message #1854877] Fri, 16 September 2022 00:55 Go to next message
Stephen Horn is currently offline Stephen HornFriend
Messages: 3
Registered: September 2022
Junior Member
My mosquitto broker is currently binded to address 192.168.2.1 on port 1883. Publishing and subscribing both work fine for programs running on the host machine where mosquitto is running (call this the Linux machine) But all remote machines cannot access the broker with pubs or subs (denote remote machines Wind10).

Client machines Wind10

They produce the following errors when attempting to publish either ---.1 or ---.104,

> .\mosquitto_pub -h 192.168.2.1 -p 1883 -t newsTest -m "remotePayload427" -u redacted -P redacted
Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
	
> .\mosquitto_pub -h 192.168.2.104 -p 1883 -t newsTest -m "remotePayload427" -u redacted -P redacted
    Error: No connection could be made because the target machine actively refused it.


  > ipconfig

    Ethernet adapter Ethernet:

       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : fe80::64e1:2bdf:413b:7660%16
       IPv4 Address. . . . . . . . . . . : 192.168.2.104
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.2.1


(there should be two screenshots here)
index.php/fa/42505/0/
.

index.php/fa/42506/0/


Host. Linux machine

The Linux machine is running the broker. Here is its current configuration.

]# more /etc/mosquitto/mosqClean.conf
user mosquit
bind_address 192.168.2.1
port 1883
protocol mqtt
log_dest syslog
log_type all
connection_messages true
log_timestamp true
allow_anonymous false
password_file /etc/mosquitto/plaintext


]# tail -f /var/log/mosquitto.log
2022-09-15T21:21:53.389752-04:00 mtcap mosquitto[23132]: mosquitto version 1.6.14 starting
2022-09-15T21:21:53.392443-04:00 mtcap mosquitto[23132]: Config loaded from /etc/mosquitto/mosqClean.conf.
2022-09-15T21:21:53.395912-04:00 mtcap mosquitto[23132]: Opening ipv4 listen socket on port 1883.
2022-09-15T21:21:53.406287-04:00 mtcap mosquitto[23132]: mosquitto version 1.6.14 running

]# netstat -t
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 192.168.2.1:ssh         192.168.2.104:56381     ESTABLISHED
tcp        0      0 192.168.2.1:ssh         192.168.2.104:50539     ESTABLISHED
tcp        0      0 192.168.2.1:ssh         192.168.2.104:50541     ESTABLISHED


]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:http            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:domain          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:ssh             0.0.0.0:*               LISTEN
tcp        0      0 192.168.2.1:1883        0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:https           0.0.0.0:*               LISTEN
tcp        0      0 :::domain               :::*                    LISTEN
tcp        0      0 :::ssh                  :::*                    LISTEN
tcp        0      0 :::https                :::*                    LISTEN
udp        0      0 0.0.0.0:domain          0.0.0.0:*
udp        0      0 0.0.0.0:bootps          0.0.0.0:*
udp        0      0 :::domain               :::*


]# more /etc/network/interfaces
auto lo
iface lo inet loopback

]# ifconfig
br0       Link encap:Ethernet  HWaddr 00:08:00:4B:DB:96
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:305983 errors:0 dropped:0 overruns:0 frame:0
          TX packets:331765 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24324031 (23.1 MiB)  TX bytes:42568583 (40.5 MiB)

eth0      Link encap:Ethernet  HWaddr 00:08:00:4B:DB:96
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:306569 errors:0 dropped:577 overruns:0 frame:0
          TX packets:335070 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24432998 (23.3 MiB)  TX bytes:42747053 (40.7 MiB)
          Interrupt:22 Base address:0xc000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:165515 errors:0 dropped:0 overruns:0 frame:0
          TX packets:165515 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:19274042 (18.3 MiB)  TX bytes:19274042 (18.3 MiB)


Notice that in netstat -t there are active ssh sessions on ----.1 . Are these interfering with the broker?

[Updated on: Fri, 16 September 2022 02:16]

Report message to a moderator

Re: Why is this mosquitto broker inaccessible to remote machines? [message #1855442 is a reply to message #1854877] Fri, 14 October 2022 11:17 Go to previous message
Gambit Support is currently offline Gambit SupportFriend
Messages: 46
Registered: March 2019
Member
The netstat output looks good.
Probably a firewall on the Linux system is preventing access.
You list some screenshots that appear to be firewall configuration.
Disable the firewall, see that it works, and you have proven that it is your firewall.

[Updated on: Fri, 14 October 2022 11:19]

Report message to a moderator

Previous Topic:Can mosquitto be used over LAN?
Next Topic:List of features for devices?
Goto Forum:
  


Current Time: Thu Apr 25 15:59:51 GMT 2024

Powered by FUDForum. Page generated in 0.03795 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top