Thursday, July 3, 2014

Networking home lab setup

Things work much better when you have static IP addresses. This means that your IP addresses won't change when you restart your VMs, which means any command lines you use will remain valid. VMWare Fusion does not make assigning IP addresses easy, but it can certainly be done.

When you created your VMs, they were assigned generated MAC addresses by Fusion. Need to retrieve those here:

Virutal Machine -> Network Adapter -> Network Adapter Settings... Turn down the "Advanced Options" disclosure triangle...



Once you have the Mac addresses for your VMs, you can change your config. One source I drew heavily on is here; you have to restart your network services if VMWare is running. And you have to be careful; Fusion loves to blow away your changes.

On my machine, here is the mapping:


# 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: 05/14/2014 16:13:27
allow unknown-clients;
default-lease-time 1800;                # default is 30 minutes
max-lease-time 7200;                    # default is 2 hours

subnet 172.16.141.0 netmask 255.255.255.0 {
 range 172.16.141.128 172.16.141.254;
 option broadcast-address 172.16.141.255;
 option domain-name-servers 172.16.141.2;
 option domain-name localdomain;
 default-lease-time 1800;                # default is 30 minutes
 max-lease-time 7200;                    # default is 2 hours
 option netbios-name-servers 172.16.141.2;
 option routers 172.16.141.2;
}
host vmnet8 {
 hardware ethernet 00:50:56:C0:00:08;
 fixed-address 172.16.141.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 jenkins {
        hardware ethernet 00:0c:29:ff:39:df;
        fixed-address 172.16.141.50;
}

host steeplechase {
        hardware ethernet 00:0c:29:5a:8e:75;
        fixed-address 172.16.141.51;
}

host linux64-negatus-01 {
        hardware ethernet 00:0c:29:b7:fe:99;
        fixed-address 172.16.141.52;
}

host linux64-negatus-02 {
        hardware ethernet 00:0c:29:69:b0:0f;
        fixed-address 172.16.141.53;
}


Restart the vmware network.

sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

This article also discusses this issue.

And we can see that all four machines are up and running by pinging them from Terminal on the same machine (they are not visible outside of the Mac):


sydpolkzillambp:~ spolk$ ping -c 1 172.16.141.50
PING 172.16.141.50 (172.16.141.50): 56 data bytes
64 bytes from 172.16.141.50: icmp_seq=0 ttl=64 time=0.355 ms

--- 172.16.141.50 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.355/0.355/0.355/0.000 ms
sydpolkzillambp:~ spolk$ ping -c 1 172.16.141.51
PING 172.16.141.51 (172.16.141.51): 56 data bytes
64 bytes from 172.16.141.51: icmp_seq=0 ttl=64 time=0.263 ms

--- 172.16.141.51 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.263/0.263/0.263/0.000 ms
sydpolkzillambp:~ spolk$ ping -c 1 172.16.141.52
PING 172.16.141.52 (172.16.141.52): 56 data bytes
64 bytes from 172.16.141.52: icmp_seq=0 ttl=64 time=0.338 ms

--- 172.16.141.52 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.338/0.338/0.338/0.000 ms
sydpolkzillambp:~ spolk$ ping -c 1 172.16.141.53
PING 172.16.141.53 (172.16.141.53): 56 data bytes
64 bytes from 172.16.141.53: icmp_seq=0 ttl=64 time=0.331 ms

--- 172.16.141.53 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.331/0.331/0.331/0.000 ms
sydpolkzillambp:~ spolk$ 

OK, so next we'll put it all together.

No comments:

Post a Comment