[Stepping on the pit record] The web environment deployed on centOS can be accessed locally but other machines cannot.

Table of contents

1 Problem description

  1. A centOS7 virtual machine is installed in VMware, and a vulnerability reproduction environment is created using wulhub on it. It can be accessed normally with a browser in centOS, but cannot be accessed on the host.
  2. The IP of centOS is, and it can be accessed normally on

2 Troubleshooting

  1. First, consider whether the host and the virtual machine can communicate normally. The host opens the cmd terminal, pings, and finds that the communication can be normal, indicating that there is no problem with the communication between the two.
  2. Since there is no problem with communication, it may be a problem with the policy settings of centOS, or a problem with the firewall settings.
  3. I searched for the commands related to the centOS firewall, you can use the command to systemctl status firewalldquery the status of the firewall, and found that it is enabled, which further confirms our guess. Further try to apply the command to service firewalld stopclose the firewall, the command execution is as shown below.
  4. The host accesses again and finds that it can be accessed normally.
  5. If it is in a production environment, the firewall cannot be simply and rudely turned off, but targeted settings should be made. For more commands, please refer to the references.

3 References

  1. What kind of firewalls does centos have
  2. Detailed explanation of CentOS7 firewall firewalld

Leave a Comment

Your email address will not be published. Required fields are marked *