11 Replies Latest reply on Mar 5, 2011 4:21 PM by RobertDGloverJr

    DHCP reservations please

    hankhero Novice

       

      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

        • 1. Re: DHCP reservations please
          WoodyZ Guru
          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.

           

           

           

          • 2. Re: DHCP reservations please
            hankhero Novice

             

            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.

             

             

             

             

             

            • 3. Re: DHCP reservations please
              rcardona2k Champion

              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.

              • 4. Re: DHCP reservations please
                WoodyZ Guru

                 

                 

                 

                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.

                 

                 

                 

                • 5. Re: DHCP reservations please
                  _henrik Lurker

                  Thanks a lot, that looks perfect! There are lot of hidden features in the config files

                  • 6. Re: DHCP reservations please
                    hankhero Novice

                     

                    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.

                     

                     

                    • 7. Re: DHCP reservations please
                      DeepakG Lurker

                      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

                      • 8. Re: DHCP reservations please
                        Guru

                        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.

                        • 9. Re: DHCP reservations please
                          DeepakG Lurker

                          Ouch, that was a stupid mistake on my part. Thanks for replying. I fixed the typo and it works like a charm now.

                          • 10. Re: DHCP reservations please
                            RobertDGloverJr Lurker

                            This information looks dead on, but in my case I have multiple Ubuntu guests, not just one.  How do I set the static IP addresses for several Ubuntu 10.04 guests?

                             

                            One possibility might be:

                             

                            host Ubuntu {

                                hardware ethernet 00:0c:29:a6:7e:xx;

                                fixed-address 172.168.55.137;

                             

                             

                               hardware ethernet 00:0c:29:a6:7e:yy;

                                fixed-address 172.168.55.138;

                             

                             

                               hardware ethernet 00:0c:29:a6:7e:zz;

                                fixed-address 172.168.55.138;

                            }

                             

                              Where the ethernet address is obtained by issuing this command at the command line in each guest:  "ifconfig"

                             

                            I wonder how to find out if this guess of mine would actually work--- is there a reference manual to look this up in?

                            • 11. Re: DHCP reservations please
                              WoodyZ Guru
                              How do I set the static IP addresses for several Ubuntu 10.04 guests?

                               

                              One possibility might be:

                               

                              host Ubuntu {

                                  hardware ethernet 00:0c:29:a6:7e:xx;

                                  fixed-address 172.168.55.137;

                               

                               

                                 hardware ethernet 00:0c:29:a6:7e:yy;

                                  fixed-address 172.168.55.138;

                               

                               

                                 hardware ethernet 00:0c:29:a6:7e:zz;

                                  fixed-address 172.168.55.138;

                              }

                               

                                Where the ethernet address is obtained by issuing this command at the command line in each guest:  "ifconfig"

                               

                              I wonder how to find out if this guess of mine would actually work--- is there a reference manual to look this up in?

                               

                               

                              You do not need any reference manual because this thread is already contains the answer and your guess it not correct nor would it work.

                               

                              Each Virtual Machine needs to be assigned separately within its own curly braces.

                               

                              Hint:  The "host ${NAME}" doesn't matter as it looks at the MAC Address and the IP Address so for 3 VM's regardless of their name the following example works just change the MAC Address and the IP Address accordingly.

                               

                              host vm1 {
                                      hardware ethernet 00:0C:29:CC:ED:18;
                                      fixed-address 172.16.198.10;
                              }
                              
                              host vm2 {
                                      hardware ethernet 00:0C:29:79:B5:05;
                                      fixed-address 172.16.198.20;
                              }
                              
                              host vm3 {
                                      hardware ethernet 00:0C:29:F3:98:FC;
                                  fixed-address 172.16.198.30;
                              }