Connecting the Home Server to the Outside World
Changing router settings to allow and forward inbound MQTT messages to the Mosquitto broker:
Enable port forwarding in the firewall settings of your router for TCP port 1883 (the MQTT default port) and TCP port 8883 (for MQTT over SSH).
Test the connection:
Subscribe on internal IP: mosquitto_sub -h my_local_ip -p 1883 -t my_topic
Publish through external IP: mosquitto_pub -h my_external_ip -p 1883 -m 'Hello World' -t my_topic









