The solution to the web service that the host cannot access the virtual machine

    Today, a vm is installed on the windows computer, and two virtual machines are installed in it. After installing jdk and tomcat, you can access the web service in the virtual machine with the ip + port of the virtual machine. But the host cannot access the virtual machine.
    Let's talk about the solution below! I can only talk about my own Oh record and make a note.
    The solution steps are as follows:
      1. Execute su root
      2. Enter the password of the root account and press Enter
      3. Execute vi /etc/sysconfig/iptables and press Enter
      4. Insert -A RH-Firewall-1-INPUT -m state -- into the file state NEW -m tcp -p tcp --
         dport 80 -j ACCEPT
      5. Press esc to exit and enter: wq
      6. Find the WWW(HTTP) option in the firewall options, and tick to save.
      7. Then you can use the host to access the web service of the virtual machine.
   Summary: In fact, this is the reason why port 80 is blocked by the Linux firewall.
   

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326571978&siteId=291194637