How to open port 18083 of the emqx web page to the host in the firewall of the virtual machine

To open port 18083 of the EMQX webpage in the firewall of the virtual machine so that the host can access it, please follow the steps below:

  1. Determine firewall status: Run the following command on the virtual machine to check the firewall status:
sudo firewall-cmd --state

If the firewall status is "running", continue to the next step. If the firewall status is "not running", it means that the firewall is disabled and you do not need to make additional settings.

  1. Determine the default zone: Run the following command to get the default zone for the current firewall:
sudo firewall-cmd --get-default-zone

The default zone is usually "public". If the default zone is different from "public", replace it with the correct zone name in the command below.

  1. Open ports: Run the following command to add a port rule in the firewall:
sudo firewall-cmd --zone=public --add-port=18083/tcp --permanent

This will add a permanent port rule in the default zone allowing access to port 18083 via the TCP protocol.

  1. Reload the firewall configuration: Run the following command to reload the firewall configuration for the changes to take effect:
sudo firewall-cmd --reload

The firewall will reload the configuration and port 18083 will be open to the host.

Now, the firewall of your virtual machine should have opened port 18083 of the EMQX web page, so that the host can access it. Please make sure that the host and the virtual machine are in the same network, and you use the IP address of the virtual machine on the host to access the EMQX web page.

If you are using other firewall management tools such as iptables, you will need to use the appropriate commands to open ports accordingly. Please refer to the documentation of the firewall management tool you are using for detailed instructions.

Guess you like

Origin blog.csdn.net/qq_43577613/article/details/131236142