To connect an external mqtt client (like MQTT.fx) to the mosquitto broker inside an Cisco LXCContainer/IOXClient.
- First enable the elevated mode in the Cisco router by typing "enable".
- Then we use the command "show ip int br" to see the configuration of the interfaces.
- The external HOST ip (192.168.118.17) and the internal ip (192.168.1.1) which is used for the Guest Operating System (GOS) and the LXC Container.
- To see the different ip addresses used for the GOS and the LXC Container, we use the command "sho ip arp | inc 192.168.1.1".
Typically the first entry is the Cisco gateway itself, the second the GOS and the third the LXC Container.
C829_OpenBerlin#show ip int br Interface IP-Address OK? Method Status Protocol GigabitEthernet0 unassigned YES NVRAM down down wlan-ap0 unassigned YES NVRAM up up GigabitEthernet1 unassigned YES unset up up GigabitEthernet2 unassigned YES unset down down GigabitEthernet3 unassigned YES unset down down GigabitEthernet4 unassigned YES unset down down Wlan-GigabitEthernet0 unassigned YES unset up up Async0 unassigned YES unset up up Async1 unassigned YES unset down down GigabitEthernet5 192.168.1.1 YES NVRAM up up Cellular0 unassigned YES NVRAM up up CellNM7 unassigned YES unset down down NVI0 192.168.1.1 YES unset up up Vlan1 192.168.118.17 YES NVRAM up up
- Finally to access the internal network from the outside, we NAT the ip address of the LXC container to the internal network, via VLAN1 with the correct MQTT port (1883).
ip nat inside source static tcp 192.168.1.4 1883 interface Vlan1 1883
Now we can connect to the MQTT broker with an external tool (MQTT.fx).
Related articles