[SOLVED] How to ping a VM from the host with NAT settings?
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I installed a Linux distro in the VirtualBox and my VM network settings is NAT. I know that with the NAT setting, my VM can ping the host OS, but host OS can't ping the VM. My VM IP address is "10.0.2.15".
Any solution for it that my host can see the VM with NAT settings?
Distribution: debian, lfs, whatever else i need in qemu
Posts: 268
Rep:
Not sure there is a way. It's on different networks anyway, even if that would have been theoretically possible. Host doesn't see that NAT network because it's not even a network for the host kernel, and VM kernel is on that "host-virtual" network. If I want to connect sshd on guest but still use NAT I would create "host-only" NIC as secondary NIC and assign some known IP there in guest and then connect that via vboxnet0 on host.
Not sure there is a way. It's on different networks anyway, even if that would have been theoretically possible. Host doesn't see that NAT network because it's not even a network for the host kernel, and VM kernel is on that "host-virtual" network. If I want to connect sshd on guest but still use NAT I would create "host-only" NIC as secondary NIC and assign some known IP there in guest and then connect that via vboxnet0 on host.
Thanks.
You can use port forwarding with NAT and SSH to your VM.
I want to connect to the Apache Server (VM2) from the host machine through the Reverse Proxy (VM1) . Which network settings are good for VM1 and VM2? For example, the network settings for VM1 must be "NAT" or "Internal Network"?
I want to connect to the Apache Server (VM2) from the host machine through the Reverse Proxy (VM1) .
Port forwarding works for other ports than 22. You can access VM1 from host by forwarding whatever port the proxy server listens on.
If both VM1 and VM2 are NAT'ed, I doubt there is a way to connect them directly. It's easiest if they are on the same network. Perhaps NAT Network is best in this case. Of course, bridging removes all these problems.
Port forwarding works for other ports than 22. You can access VM1 from host by forwarding whatever port the proxy server listens on.
If both VM1 and VM2 are NAT'ed, I doubt there is a way to connect them directly. It's easiest if they are on the same network. Perhaps NAT Network is best in this case. Of course, bridging removes all these problems.
I want my host OS can't see VM2 directly, but VM1 can.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.