views:

2621

answers:

5

I'm running my workstation on Server 2008 and a few servers in Hyper-V VM's on that server. I connect to my corporate LAN using VPN from the main OS (the host) but my VM's aren't seeing the servers in the corporate LAN. Internet and local access to my home network work fine. Each of the VMs has one virtual network adapter.

What should I try to make it work?

Maybe I need to provide more details, please ask if needed.

More details:

  • cannot start multiple VPN connections
  • not using NAT through the host
  • VM gets IP address from the home network router (DHCP)
A: 

Setup some routes in your routing tablke. It really depends on how its setup but if you can access your corp network fine on the host, then setup the routes in your vm machines.

Also, as I am not familiar with that VM, are the network adapters like VMWares bridged adapaters? If so you need to setup the route to route to your host.

mattlant
Sounds promising, except that I know nothing about routing tables. I guess I have a lot of reading to do.
sergiopereira
A: 

What type of VPN are you using? Ar you using the built-in windows VPN client, or do you have to install the client ?

You could just set up the VPN client independently on every VM, providing you are allowed multiple simultaneous connections.

I don't think that setting up routes would work because then you will also need to set up routes on your company network.

zvikara
you dont need routes unless requests nee to be made in that direction.
mattlant
I'm using the Windows built-in client. I'm not allowed multiple connections, unfortunately.
sergiopereira
A: 

Let me make sure something clearer. You servers act as if they are physically seperated from your host. So with that in mind they need to be setup the same way as if they were seperated. That means that they need a route in their routing table. Why? Because right now their default route is to the internet via your gateway, NOT your host.

In short, approach the problem the way you would if they were not VM's and they were real servers on your network.

But as I aksed in my initial repsonse, Are they like VMWare bridged adapters. If they are what I say stands. If they are not, then thats a different story. FOr example, if they are setup in a NAT with your host, VPN should already work. Any other situation will require further investigation and more information.

mattlant
My VM settings for the network adapter in Hyper-V gives me 3 options: Not connected, Internal Network, and Broadcom NetXtreme Gigabit (my physical card). I'm not using NAT as far as I can tell (not a networking expert here), so yes, I think this is like VMWare's bridged adapters.
sergiopereira
If so, see next post, this should help
mattlant
+1  A: 

Like I said you need to setup some routes. Add a route to your Corp LAN via your Host as the gateway. Just the fact alone you telling me that it gets it from home DHCPP tells me that is the issue. Your VM's only see 1 default gateway, and that is to the internet. The VM's have no idea whatsoever that the Host has a VPN on it. Adding that route (on VM machines) causes any requests that your VM's make to the subnet of your corp network to route through your host rather than the home router.

Adding something like this:

route ADD 10.0.0.0 MASK 255.0.0.0 192.168.1.30

on your VM'S would do this: Any requests made to the 10...* network would route through the computer with the IP address of 192.168.1.30. So replace the 10.0.0.0 and subnet with your corp lan, and the 192 ip with your hosts IP. That should take care of the issue.

mattlant
this is done as an admin in a command console on windows. If its a linux box the command is very similar, but you will have to look at the man page for the exact structure of it.
mattlant
I had just read about the route command but did not try it yet to avoid adding more variables to the problem. I'll try after work and let you know. Thanks.
sergiopereira
Note: I had a similar problem, and ended up switching the VM to use NAT, which allowed it to "see" the host's VPN connection.
J c
A: 

Hi all,you can also check more about proxy and vpn here