4

I want to connect a Linux VM running in VMWare on a Windows 7 laptop to an enterprise network using host-only configuration.

I was able to setup bidirectional routing between "host-only" VMWare network and the enterprise network. If I add DNS servers to /etc/resolv.conf and a default route then there is full bidirectional connectivity. Traffic flows between enterprise network and host-only network, and NAT is performed later by the enterprise WAN gateway.

However, out of the box no default route is passed over DHCP, and the DNS server provided doesn't work.

I have the following topology:

VM - 192.168.4.3 -- host only network -- 192.168.4.1 -- laptop VMWare host -- 192.168.1.4 -- enterprise network -- 192.168.1.1 -- WAN Gateway -- Internet

DHCP sets up 192.168.4.1 (the laptop interface facing host only network) as the DNS server on the VM host. VMWare has a DNS proxy which works fine in NAT mode but it refuses to work in host-only mode.

So I have 2 questions:

  1. How do I configure VMWare so it sets correct DNS (either DNS known on host, e.g. 192.168.1.1, a working VMWare DNS Proxy or a good static DNS e.g. 8.8.8.8/8.8.4.4 Google Public DNS)

  2. How do I configure VMWare so it sets a proper default route to 192.168.4.1?

nponeccop
  • 354
  • 3
  • 16
  • Why wouldn't you just choose bridged mode? – SpacemanSpiff Aug 27 '12 at 13:29
  • I want vmware host to have the same static IP, even if I connect my laptop at an airport. NAT doesn't seem to be good idea either as I will need port forwarding so users from enterprise network can connect to my virtual server. – nponeccop Aug 27 '12 at 13:31
  • Makes sense then... in that case, don't use DHCP at all. use a static configuration and persistent static routes. – SpacemanSpiff Aug 27 '12 at 13:39
  • This is what I resorted to. However, it has few small flaws: 1) in case of several VMs I have to configure several times instead of one. And IP floating because of DHCP is rare and acceptable. 2) Static route configuration is somewhat cumbersome on Arch Linux I use 3) Static DNS configuration is only possible with Google DNS which admin perverts may close in their firewalls, so it's better to set whatever DNS host has which is only possible dynamically. – nponeccop Aug 27 '12 at 14:05
  • I don't see any other alternative given the inflexibility of the DHCP server that comes with workstation, unless you setup a VM just for doing DHCP for that segment :) – SpacemanSpiff Aug 27 '12 at 14:13
  • It is flexible but undocumented - I found a partial solution by editing `vmnetdhcp.conf` file by hand. Routes and DNS are now automatic, but DNS is static as opposed to taken from whatever the host has. – nponeccop Aug 27 '12 at 16:58

0 Answers0