简体   繁体   中英

configure VM to ping a VM in another subnet

I have a rather theoretical question and I am not very experienced with networking:

Situation:

  • I have 4 virtual machines which have to be configured.
  • The OS is freely selectable by me as well as the virtual hardware specs.
  • VM 1 is in subnet 1 and is connected to VM2 via LAN and uses VM2 as a standard gateway.
  • VM 2 is in subnet 1 and is directly connected to the internet.
  • VM 3 is in subnet 2 and is directly connected to the internet.
  • VM 4 is in subnet 2 and is connected to VM3 via LAN and uses VM3 as a standard gateway.

Question:

How can I configure the VMs so that VM 1 can ping VM 4?

Thoughts

I guess I need some kind of routing between VM 1 and 4?

It sounds like your current configuration looks like this:

VM1 -> VM2 -> Internet

VM4 -> VM3 -> Internet

As you stated there is no routing going on between the two subnets, VM2 and VM3 are acting as the router/NAT device for two separate networks. If you want VM4 and VM1 to be able to reach each other they need to be using the same router, so you would have this:

    VM1 -> 
           VM2 -> Internet
    VM4 ->

Here VM2 is the router/NAT device for VM1 and VM4 (which are on separate networks). You don't need 4 machines to do this unless there is something else specific you are trying to accomplish.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM