0

I've set up apache and the relevant firewall services on CentOS 7. If I set the network to bridged then I can access the web server from the host computer using 192.168.0.87.

However when I change it to host-only, the IP changes to 192.168.22.128. then if I try and navigate to that address on the host it can't connect, even though it has the IP of 192.168.22.1 in the virtual adapter.

NOTE that in host only mode I can still SSH from the host to the vm using 192.168.22.128

  • Exactly what do you mean by "it has the IP of 192.168.22.1 in the virtual adapter"? Also, if you can ssh into the VM but http/https don't work, then it's a configuration problem in your guest. Either it has a firewall blocking traffic or your webserver is no longer listening on the correct address. – jamesdlin Sep 25 '18 at 2:14
  • I meant "it has the IP of 192.168.22.1 in the virtual adapter" just to show that the host is on the same network as the guest. i believe the firewall is correctly set http and https traffic is allowed because if i switch to bridged connection, the web server works and can be accessed by the host. Ill double check to ensure it is listening on that address although it is the default Apache configuration so i would assume it would listen on any ip it was on. – Leon W Sep 25 '18 at 14:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.