XIII
Very Senior Member
Somehow I can publish MQTT messages from my Raspberry Pi to my own MQTT broker (on the same Raspberry Pi), but not from my router.
I'm not sure what's wrong. Who can help?
Setup:
Working on Pi (using domain name, DDNS, and port forwarding):
NOT working on router (using domain name, DDNS, and port forwarding):
Error message:
Working on router (direct access to Pi):
(The --insecure is needed because the domain name will not match the certificate)
It looks like something is blocking the router to connect to the MQTT broker via domain name, DDNS, and port forwarding?
On Pi (domain name):
reports
On router (domain name):
reports
On router (Pi):
reports
Note: I run the "ufw" firewall on the Raspberry Pi, with this rule for port 8883:
I do run SkyNet, but don't see anything being added to its log while trying this.
What can be blocking the router to publish MQTT messages? How to fix it?
I'm not sure what's wrong. Who can help?
Setup:
- Mosquitto MQTT server with valid Let's Encrypt certificates on Raspberry Pi on port 8883
- Personal domain name mqtt.domain.com redirected to hostname.asuscomm.com
- Port 8883 on router forwarded to Raspberry Pi
- Entware packages ca-bundle and ca-certificates installed on router
- AC86U router with Merlin 384.13 firmware
Working on Pi (using domain name, DDNS, and port forwarding):
Code:
mosquitto_pub -h mqtt.domain.com -p 8883 -u username -P password -t topic -m message --capath /etc/ssl/certs
NOT working on router (using domain name, DDNS, and port forwarding):
Code:
mosquitto_pub -h mqtt.domain.com -p 8883 -u username -P password -t topic -m message --capath /opt/etc/ssl/certs
Code:
Error: Connection refused
Working on router (direct access to Pi):
Code:
mosquitto_pub -h pi.home.lan -p 8883 -u username -P password -t topic -m message --capath /opt/etc/ssl/certs --insecure
(The --insecure is needed because the domain name will not match the certificate)
It looks like something is blocking the router to connect to the MQTT broker via domain name, DDNS, and port forwarding?
On Pi (domain name):
Code:
nmap mqtt.domain.com -p 8883
Code:
8883/tcp open secure-mqtt
On router (domain name):
Code:
nmap mqtt.domain.com -p 8883
Code:
8883/tcp closed secure-mqtt
On router (Pi):
Code:
nmap pi.home.lan -p 8883
Code:
8883/tcp open secure-mqtt
Note: I run the "ufw" firewall on the Raspberry Pi, with this rule for port 8883:
Code:
8883 ALLOW Anywhere
I do run SkyNet, but don't see anything being added to its log while trying this.
What can be blocking the router to publish MQTT messages? How to fix it?
Last edited: