Setting Up A Local Lab


Software

After setting up the hardware and the layout of the lab, it's time to start filling it up with software, giving the lab some functionality. A few areas which you might want inside the lab are:

Daemons/Services

DHCP
A Dynamic Host Configuration Protocol (DHCP) server automatically assigns IP addresses to nodes.
A brief break down of how DHCP works:
  • When a node first connects to a network the DHCP client on the node (if it has one installed), sends out a "broadcast" message (DHCPDISCOVER).
  • If there is a response (DHCPOFFER), both parties will then start to negotiate (DHCPREQUEST & DHCPACK) an IP address from the 'pool' (a range of IP addresses allowed to be used). The DHCP server replies to DHCP client (DHCPACK) with various pieces of information such as an IP address, gateway, DNS and any other server(s) (e.g. name and/or time).
  • It will also establish & send a 'lease' on the IP address used. This is how long the IP address, just issued, is 'valid' for.
  • Depending on how the DHCP server is configured it will issue the IP address in a different way, such as:
    • Dynamic Allocation - Sends the first 'free' (an un-used/non-leased) IP address from the pool. This 'recycles' IP addresses when they are no-longer used.
    • Automatic Allocation - The same as 'Dynamic Allocation', however the DHCP server keeps track of the IP address to which client it was issued to, allowing them to be permanently/preferentially re-assigned the previous IP address again.
    • Static Allocation - An IP address 'paired' (matched up) with a MAC address. If the client's MAC address isn't on this list, then an IP address isn't issued. However, if it is, the client will have the matching IP address for their MAC address.
DHCP clients have to 'renew' their lease before it expires, allowing them to keep their existing values.
However, they can also 'release' the DHCP lease, informing the DHCP server it's no longer in use.

Windows

If the chosen VM you wish to setup a DHCP server on is a part of "Microsoft Windows Server" family, you can use the integrated service. For the other Windows OSs you can use any 3rd party applications.

Windows Server 2000/2003

  1. Start --> Control Panel --> Add or Remove Programs
  2. Add/Remove Windows Components
  3. Wait
  4. Networking Services --> Details --> Tick: 'Dynamic Host Configuration Protocol (DHCP)' --> Okay --> Next
  5. Wait
  6. This screen is due to all the network interfaces being set to use DHCP to be assigned an IP address.
  7. Internet Protocol (TCP/IP) --> Properties
  8. Manually set the IP address & subnet (172.16.128.1/24) --> Ok
  9. Finish
  10. Start --> All Programs --> Administrative Tools --> DHCP
  11. DHCP --> Right click: <hostname> --> New Scope
  12. Next --> Name & Description --> Next
  13. Start & End IP Address, Length/Subnet mask --> Next
  14. Any IP Exclusions --> Next
  15. DHCP Lease duration --> Next
  16. Select 'Yes, I want to configure these options now' --> Next
  17. Router --> Next
  18. Domain Name & DNS Server --> Next
  19. WINS Server --> Next
  20. Select: 'Yes, I want to active this scope now' --> Next
  21. Finish
  22. Start --> Control Panel --> Network Connections --> <Interface> --> Right click: 'Properties'
  23. Advanced --> Settings
  24. Exceptions --> Add Port
  25. Port Number: 67 & UDP --> Ok --> Ok
  26. Done! (Check by connecting another VM on the same virtual network)
  27. You can see the leases & Alter any reservations on IPs
dhcp-server2003-1.png dhcp-server2003-2.png dhcp-server2003-3.png dhcp-server2003-4.png dhcp-server2003-5.png dhcp-server2003-6.png dhcp-server2003-7.png dhcp-server2003-8.png dhcp-server2003-9.png dhcp-server2003-10.png dhcp-server2003-11.png dhcp-server2003-12.png dhcp-server2003-13.png dhcp-server2003-14.png dhcp-server2003-15.png dhcp-server2003-16.png dhcp-server2003-17.png dhcp-server2003-18.png dhcp-server2003-19.png dhcp-server2003-20.png dhcp-server2003-21.png dhcp-server2003-22.png dhcp-server2003-23.png dhcp-server2003-24.png dhcp-server2003-26.png dhcp-server2003-27.png dhcp-server2003-28.png dhcp-server2003-29.png dhcp-server2003-30.png dhcp-server2003-31.png dhcp-server2003-32.png dhcp-server2003-33.png dhcp-server2003-34.png


Windows Server 2008

  1. Start --> Server Manager
  2. Add Roles
  3. Next
  4. This screen is due to all the network interfaces being set to use DHCP to be assigned an IP address. Cancel
  5. Start --> Control Panel --> Network and Sharing Center --> Manage network connections
  6. <Interface> --> Right click: 'Properties'
  7. Internet Protocol (TCP/IP) --> Properties
  8. Manually set the IP address & subnet (172.16.128.1/24) --> Ok --> Ok
  9. Next --> <Interface> --> Next --> DNS --> Next --> Win --> Next --> Add --> Name, Start & End IP Address, Subnet, Gateway, Subnet Type. Tick: 'Activate this scope' --> Ok --> Next
  10. 'Enable DHCPv6 stateless mode for this server' --> Next
  11. DNSv6 --> Next
  12. Install
  13. Wait
  14. Close
  15. Done! (Check by connecting another VM on the same virtual network)
  16. You can see the leases & Alter any reservations on IPs You can see the leases & Alter any reservations on IPs
dhcp-server2008-1.png dhcp-server2008-2.png dhcp-server2008-3.png dhcp-server2008-4.png dhcp-server2008-5.png dhcp-server2008-6.png dhcp-server2008-7.png dhcp-server2008-8.png dhcp-server2008-9.png dhcp-server2008-10.png dhcp-server2008-12.png dhcp-server2008-13.png dhcp-server2008-14.png dhcp-server2008-15.png dhcp-server2008-16.png dhcp-server2008-17.png dhcp-server2008-18.png dhcp-server2008-19.png dhcp-server2008-20.png dhcp-server2008-21.png dhcp-server2008-22.png dhcp-server2008-24.png dhcp-server2008-25.png dhcp-server2008-26.png


Windows Server 2012

  1. Server Manager
  2. Add roles and features
  3. Next
  4. Select: 'Role-based or feature-based installation' --> Next
  5. Select: 'Select a server from the server pool' --> Select server --> Next --> Next
  6. Add Features
  7. This screen is due to all the network interfaces being set to use DHCP to be assigned an IP address. Cancel
  8. Start --> Control Panel --> View network status and tasks --> Change adapter settings
  9. <Interface> --> Right click: 'Properties'
  10. Internet Protocol (TCP/IP) --> Properties
  11. Manually set the IP address & subnet (172.16.128.1/24) --> Ok --> Ok
  12. Next --> Next --> Install
  13. Wait
  14. Complete DHCP configuration --> Commit-> Close
  15. Close
  16. Tools --> DHCP
  17. Right click: 'IPv4' --> New Scope
  18. Next --> Name & Description --> Next
  19. Start & End IP Address, Length/Subnet mask --> Next
  20. Any IP Exclusions --> Next
  21. DHCP Lease duration --> Next
  22. Select 'Yes, I want to configure these options now' --> Next
  23. Router --> Next
  24. Domain Name & DNS Server --> Next
  25. WINS Server --> Next
  26. Select: 'Yes, I want to active this scope now' --> Next
  27. Finish
  28. Done! (Check by connecting another VM on the same virtual network)
  29. You can see the leases & Alter any reservations on IPs
dhcp-server2012-1.png dhcp-server2012-2.png dhcp-server2012-3.png dhcp-server2012-5.png dhcp-server2012-6.png dhcp-server2012-7.png dhcp-server2012-8.png dhcp-server2012-9.png dhcp-server2012-10.png dhcp-server2012-11.png dhcp-server2012-12.png dhcp-server2012-13.png dhcp-server2012-14.png dhcp-server2012-15.png dhcp-server2012-16.png dhcp-server2012-17.png dhcp-server2012-18.png dhcp-server2012-19.png dhcp-server2012-20.png dhcp-server2012-21.png dhcp-server2012-23.png dhcp-server2012-24.png dhcp-server2012-25.png dhcp-server2012-26.png dhcp-server2012-27.png dhcp-server2012-28.png dhcp-server2012-29.png dhcp-server2012-30.png dhcp-server2012-31.png dhcp-server2012-32.png dhcp-server2012-33.png dhcp-server2012-34.png dhcp-server2012-35.png dhcp-server2012-36.png dhcp-server2012-37.png dhcp-server2012-38.png dhcp-server2012-39.png dhcp-server2012-40.png dhcp-server2012-41.png dhcp-server2012-42.png dhcp-server2012-43.png


tftpd32

  1. Download and extract (Download page)
  2. If prompted 'Unblock' to allow through the firewall
  3. Settings --> Tick: 'DHCP Server' (Disable all other un-wanted services)
  4. DHCP --> IP pool starting address, Size of pool, Mask, Domain name
  5. Ok --> And close & reopen TFTP32
  6. Done! (Check by connecting another VM on the same virtual network)
  7. You can see a log of the leases
dhcp-tftpd32-1.png dhcp-tftpd32-2.png dhcp-tftpd32-3.png dhcp-tftpd32-4.png dhcp-tftpd32-5.png dhcp-tftpd32-6.png dhcp-tftpd32-7.png dhcp-tftpd32-8.png dhcp-tftpd32-9.png


dhcpsrv

  1. Download and extract (Download page)
  2. Next --> <Interface> --> Next -->
  3. Enable any other wanted services --> Next
  4. Configure size of DHCP Pool & Lease
  5. DHCP Options --> Domain Name --> Ok
  6. Advanced --> Subnetmask --> Ok
  7. Write INI --> Next
  8. Services --> Install --> Start. Firewall --> Configure. Tick: 'Run DHCP server immediately' --> Finish
  9. Check settings --> Continue as tray app
  10. Yes
  11. Done! (Check by connecting another VM on the same virtual network)
dhcp-dhcpserv-1.png dhcp-dhcpserv-2.png dhcp-dhcpserv-3.png dhcp-dhcpserv-4.png dhcp-dhcpserv-5.png dhcp-dhcpserv-6.png dhcp-dhcpserv-7.png dhcp-dhcpserv-8.png dhcp-dhcpserv-9.png dhcp-dhcpserv-10.png dhcp-dhcpserv-11.png dhcp-dhcpserv-12.png dhcp-dhcpserv-13.png dhcp-dhcpserv-14.png dhcp-dhcpserv-15.png


Linux

Linux also has various DHCP server solutions. It is very common to have at least one DHCP daemon in the OS's repositories, which is a very easy way install applications.
Depending on the package manager installed (by default: debian uses "Advanced Packaging Tool (APT)" & Red hat uses "Yellowdog Updater Modified (YUM)") you have to alter the commands slightly and the packages name.
Below is the commands used to install a DHCP service on Ubuntu 12.10 & CentOS 6.1:
  1. apt-cache search dhcp-server (Or 'yum search dhcp')
  2. sudo apt-get install isc-dhcp-server (Or 'sudo yum install dhcp')
  3. sudo cp /etc/dhcp/dhcpd.conf{,.bak}
  4. sudo vi /etc/dhcp/dhcpd.conf
    ddns-update-style none;
    
      option domain-name "lab";
      #option domain-name-servers 172.16.128.1;
      #option routers 172.16.128.1;
    
      default-lease-time 600;
      max-lease-time 7200;
    
      authoritative;
    
      log-facility local7;
    
      subnet 172.16.128.0 netmask 255.255.255.0 {
      range 172.16.128.2 172.16.128.254;
      }
  5. sudo cp /etc/network/interfaces{,.bak}
  6. sudo vi /etc/network/interfaces
  7. sudo service isc-dhcp-server restart (Or 'sudo service dhcpd-server restart')
  8. Done! (Check by connecting another VM on the same virtual network)