VMware Communities > VMTN > Desktop Products > VMware Fusion (for the Mac) > Discussions

This Question is Answered

2 "helpful" answers available (6 pts)
9 Replies Last post: Feb 3, 2009 10:44 AM by DeepakG
Reply

DHCP reservations please

Dec 28, 2007 3:09 AM

Click to view hankhero's profile Novice hankhero 5 posts since
Dec 28, 2007

Running under NAT, it would be nice to know that the virtual machine I use daily always get the same IP adress from the Fusion dhcp server.

This feature is known as DHCP Reservations on my router, but I prefer it directly with Fusion.

"DHCP Reservations allow the DHCP server to associate a fixed IP address with a specific MAC address."


Is this possible? Or is there some known workaround? I mainly use a VM with Xubuntu 32 bit.

Otherwise regard it as an important feature request.

Kind regards,

Henrik

Reply Re: DHCP reservations please Dec 30, 2007 3:33 AM
Click to view WoodyZ's profile Guru WoodyZ 9,999 posts since
Apr 22, 2004
hankhero wrote:
Running under NAT, it would be nice to know that the virtual machine I use daily always get the same IP adress from the Fusion dhcp server.

This feature is known as DHCP Reservations on my router, but I prefer it directly with Fusion.

"DHCP Reservations allow the DHCP server to associate a fixed IP address with a specific MAC address."

Just curious, what is the Make, Model and Version of the Router you're using?

Since your using a Router you do not need to use NAT on the VM's Network. Just set the VM's Network to Bridged and then configure the NIC at the OS Level using an IP Address that is outside the Scope of the Router's DHCP Server IP Address Pool while supplying the appropriate Subnet Mask, Gateway and DNS Server(s) IP Addresses as well.

Reply Re: DHCP reservations please Dec 30, 2007 10:35 AM
in response to: WoodyZ
Click to view hankhero's profile Novice hankhero 5 posts since
Dec 28, 2007

The router I use, I don't know the exact brand out of my head and it's at my office, but I think it is a 3com office connect wlan/router.

The problem with using the router for this is that I have a MacBook and I want to take it out of the office sometimes Then the IP address will be wrong again. That is why I would like VMWare to have a similar feature. This is a very useful feature for software development when you want to simulate several servers and clients, probably really easy to implement for VMWare as well.


Reply Re: DHCP reservations please Dec 30, 2007 11:13 AM
Click to view rcardona2k's profile Champion rcardona2k 5,121 posts since
Oct 20, 2005
You can add a static mapping for your VM's MAC address via NAT by editing dhcpd.conf in /Library/Application Support/VMware Fusion/vmnet8/dhcpd.conf

The syntax is:

# Assign a static IP to Xubuntu

host xubuntu {
hardware ethernet 00:0C:29:XX:YY:ZZ;
fixed-address 1x2.168.xxx.yyy;
}

You must restart the dhcpd server easily by running sudo boot.sh --restart in the VMware Fusion directory above. If Xubuntu has the IP you want already, it should keep it.
Reply Re: DHCP reservations please Dec 30, 2007 11:11 AM
in response to: hankhero
Click to view WoodyZ's profile Guru WoodyZ 9,999 posts since
Apr 22, 2004

hankhero wrote: The problem with using the router for this is that I have a MacBook and I want to take it out of the office sometimes Then the IP address will be wrong again. That is why I would like VMWare to have a similar feature. This is a very useful feature for software development when you want to simulate several servers and clients, probably really easy to implement for VMWare as well.

I doubt that feature is one that will come anytime soon as there are far to many features more important to larger groups of users that will probable get implemented first.

I don't use Xunbuntu but I'd imaging you could create some scripts with various different network configurations to automate the process on the OS side. On my Windows Notebooks and Windows VM's on my MBP, I use a VB Script that defines all the different Network Configurations I need and an based on which Network Environment I'm in and I just run the Script with the appropriate argument and it reconfigures the NIC on-the-fly without having to reboot. Very easy and simple solution to having to work within multiple Network Environments.

Reply Re: DHCP reservations please Dec 31, 2007 7:30 AM
in response to: rcardona2k
Click to view _henrik's profile Lurker _henrik 3 posts since
Dec 23, 2006
Thanks a lot, that looks perfect! There are lot of hidden features in the config files :)
Reply Re: DHCP reservations please Jan 2, 2008 1:42 AM
in response to: rcardona2k
Click to view hankhero's profile Novice hankhero 5 posts since
Dec 28, 2007

I have now tried and can confirn that it works, thanks a lot!

This should go into the documentation somewhere IMO.

Also, I was wrong about the make of the router, it is called D-Link Dl-724GU.

Reply Re: DHCP reservations please Feb 3, 2009 12:03 AM
Click to view DeepakG's profile Lurker DeepakG 2 posts since
Feb 2, 2009
Hi Folks,

This doesn't seem to work for me - I am on Ubuntu 8.10 (guest) and VMWare Fusion 2 (host). The guest keeps getting a new IP address and not the static one that I specified in the dhcp.conf file. This is what my dhcp.conf file looks like:

allow unknown-clients;
default-lease-time 1800; # 30 minutes
max-lease-time 7200; # 2 hours

subnet 172.16.55.0 netmask 255.255.255.0 {
range 172.16.55.128 172.16.55.254;
option broadcast-address 172.16.55.255;
option domain-name-servers 172.16.55.2;
option netbios-name-servers 172.16.55.2;
option domain-name "localdomain";
option routers 172.16.55.2;
}

host Ubuntu {
hardware ethernet 00:0c:29:a6:7e:77;
fixed-address 172.168.55.137;
}

I've double checked the value of the MAC address. I've also tried deleting the existing leases under /var/db/ on host and /var/lib/dhcp3/ on guest

For now I've given a static value to the guest manually. What could I be doing wrong?

Thanks,
Deepak
Reply Re: DHCP reservations please Feb 3, 2009 9:01 AM
in response to: DeepakG
Click to view etung's profile Guru etung 11,030 posts since
Oct 15, 2006
VMware
Not sure if this is what's going wrong, but the DHCP server gives out addresses in the range 172.16.55.128-254 and you're specifying a fixed address of 172.168.55.137.
Reply Re: DHCP reservations please Feb 3, 2009 10:44 AM
in response to: etung
Click to view DeepakG's profile Lurker DeepakG 2 posts since
Feb 2, 2009
Ouch, that was a stupid mistake on my part. Thanks for replying. I fixed the typo and it works like a charm now.
Actions