Static IPs From DHCPD In VMware Fusion

Most of my virtual machines for VMware Fusion use NAT for networking to avoid conflicts with external IPs.  However, by default, you only get dynamically assigned IPs albeit almost the same IP for each VM you run.  What I want is a real static IP assigned for each VM.

I navigate to the following directory using the bash shell in the Terminal screen:

    /Library/Application Support/VMware/vmnet8

If you do an ‘ls‘ to see the contents of the directory, you’ll find a file called dhcpd.conf.  (Note:  Your installation may have a different vmnetx directory.  Just make sure you do get to modify the right one.)  It is this file that we’re interested in.  I edit this file and add some entries to enable static IP assignment for each VM I want to have a static IP:

# Configuration file for ISC 2.0 vmnet-dhcpd operating on vmnet8.
#
# This file was automatically generated by the VMware configuration program.
# See Instructions below if you want to modify it.
#
# We set domain-name-servers to make some DHCP clients happy
# (dhclient as configured in SuSE, TurboLinux, etc.).
# We also supply a domain name to make pump (Red Hat 6.x) happy.
#

###### VMNET DHCP Configuration. Start of "DO NOT MODIFY SECTION" #####
# Modification Instructions: This section of the configuration file contains
# information generated by the configuration program. Do not modify this
# section.
# You are free to modify everything else. Also, this section must start
# on a new line
# This file will get backed up with a different name in the same directory
# if this section is edited and you try to configure DHCP again.

# Written at: 03/21/2010 10:15:52
allow unknown-clients;
default-lease-time 1800;                # default is 30 minutes
max-lease-time 7200;                    # default is 2 hours

subnet 172.16.167.0 netmask 255.255.255.0 {
        range 172.16.167.128 172.16.167.254;
        option broadcast-address 172.16.167.255;
        option domain-name-servers 172.16.167.2;
        option domain-name localdomain;
        default-lease-time 1800;                # default is 30 minutes
        max-lease-time 7200;                    # default is 2 hours
        option routers 172.16.167.2;
}
host vmnet8 {
        hardware ethernet 00:50:56:C0:00:08;
        fixed-address 172.16.167.1;
        option domain-name-servers 0.0.0.0;
        option domain-name "";
        option routers 0.0.0.0;
}
####### VMNET DHCP Configuration. End of "DO NOT MODIFY SECTION" #######

host mesmer {
    hardware ethernet 00:0c:29:95:20:3d;
    fixed-address 172.16.167.4;
    option domain-name "hq.linuxunbound.com";
}

host spock {
    hardware ethernet 00:0c:29:bf:2e:05;
    fixed-address 172.16.167.5;
    option domain-name "hq.linuxunbound.com";
}

host starscream {
    hardware ethernet 00:0c:29:2e:ab:d6;
    fixed-address 172.16.167.6;
    option domain-name "hq.linuxunbound.com";
}

host beaker {
    hardware ethernet 00:0c:29:34:1c:7e;
    fixed-address 172.16.167.7;
    option domain-name "hq.linuxunbound.com";
}

host tomahawk {
    hardware ethernet 00:0c:29:ca:37:14;
    fixed-address 172.16.167.8;
    option domain-name "hq.linuxunbound.com";
    option host-name "tomahawk";
}

Note above that I extracted the Ethernet addresses from /sbin/ifconfig while the VM was running.  Also note that the entries I made were done after the end of the “DO NOT MODIFY” section.  In the last entry for host tomahawk, I added the following entry to let DHCPD assign the hostname automatically:

option host-name “tomahawk”;

After adding everything in dhcpd.conf, I shutdown the VMs running properly and quit VMware Fusion completely.  Then, back in Terminal, I change directory to

    /Library/Application Support/VMware/

and execute the following command:

    sudo ./boot.sh --restart

The above command restarts the processes (such as DHCPD) needed by VMware Fusion to properly run the VMs.

I then start VMware Fusion once more and run the VMs.  Each VM that was specified to receive a static IP in dhcpd.conf does indeed get the right IP.

Hello World

Hello World!

Welcome to the newly relaunched Linux Unbound website.  This website hopes to give you various kinds of information on Linux which runs on many devices and platforms.  We hope to also give you a glimpse of our exploring Linux on real and virtual machines, small and big ones, and even “clouds”.  We’ll even share our misadventures so we can exchange notes and learn from them.

Enough said, we hope you come back in a couple of days to read our first entry in this site.

Keep exploring!