20 Dynamic Host Configuration Protocol – MikroTik CHR

Jacob Christensen

Thus far, we’ve explored two approaches to integrating DHCP servers into a network using both Linux and Windows as dedicated servers. This chapter introduces yet another method for deploying DHCP, in the form of a router. This proves particularly handy in scenarios where a quick and easy solution is required. Configuring DHCP in this manner offers rapid deployment and simplicity, making it ideal fit smaller network environments.

Estimated time for completion: 10 minutes

Learning objectives

  • Successfully deploy a DHCP solution using a MikroTik router on an enterprise network
  • Capture and Observe DHCP packets using Wireshark
  • Capture and Observe ARP packets using Wireshark
  • Successfully add hosts to an enterprise network and receive IP addresses automatically

Prerequisites

Deliverables

Five screenshots are required:

  • Neatly labeled and organized GNS3 workspace
  • MikroTik router configuration
  • Screenshot of Wireshark
    • DHCP packets for PC1
    • DHCP packets for PC2
    • PC1 pinging PC2

Resources

Contributors and testers

  • Dante Rocca, Cybersecurity Student, ERAU-Prescott

Phase I -Build the Network Topology

The following steps are to create a baseline environment for completing the lab.  It makes assumptions about learner knowledge from completing previous labs.

Your final network will look like the following:

GNS3 environment
Figure 1 – Final GNS3 network environment
  1. Start GNS3
    1. Create a new project: LAB_06
  2. Build a Class C subnet with the network address 178.58.58.0/24
    1. Two client devices – VPCS
    2. One switch – Ethernet switch
    3. One DHCP server – MikroTik router

      NOTE: The MikroTik CHR version used when making this lab was 7.11.3.

    4. Connect the PCs to the switch
    5. Connect port ether1 on the router to the switch
  3. Label and organize your network as necessary

Phase II – Configuring the MikroTik Router

Once the network is built we need to configure the router to act as our DHCP server.

  1. Start the MikroTik router and open its console
    1. Change the hostname to reflect the router’s primary purpose

      > system identity set name=DHCP-SERVER

    2. Remove the default DHCP listener on ether1

      > ip dhcp-client remove 0

      terminal command execution
      Figure 2 – Removing the DHCP client
    3. Assign a static IP address to its running interface

      > ip address add address=178.58.58.254/24 interface=ether1

      NOTE: In this example, I have ether1 connected to the switch. Remember to adjust this to be applicable for your environment.

      terminal command execution
      Figure 3 – Assigned IPv4 addresses
    4. Use the built-in setup wizard to configure the DHCP server (Figure 4)

      > ip dhcp-server setup

      1. dhcp server interface: ether1
      2. dhcp address space: 178.58.58.0/24
      3. gateway for dhcp network: 178.58.58.254
      4. addresses to give out: 178.58.58.1-178.58.58.253
      5. dns servers: (none just hit <Enter> )
      6. lease time: 1800
  2. Test the DHCP service on the network
    1. From PC1, request a new host address

      > ip dhcp

    2. From PC2, request a new host address

      > ip dhcp

  3. From PC1, ping PC2 to test connectivity
End of Lab

Deliverables

Five screenshots are required to receive credit for this exercise:

  • GNS3 workspace with all devices labeled
  • MikroTik router configuration
  • Wireshark capture of PC1 devices getting and receiving DHCP IPv4 addresses
  • Wireshark capture of PC2 devices getting and receiving DHCP IPv4 addresses
  • Wireshark caputre of PC1 pinging PC2

Homework

Assignment 1 – Create a LAN for 43 hosts with a Mikrotik DHCP server while minimizing unused IP addresses

  • Used a randomized network address
  • There’s no need to put in all 43 host just show the setup process for the DHCP server and that it is working with at least two hosts
  • RECOMMENDED GRADING CRITERIA
    • Screenshot of GNS3 Environment
    • Screenshot of end devices receiving IP addresses
    • Screenshot of DHCP setup process

Assignment 2 – Use the Mikrotik router as both a DHCP server and a router

  • Add another LAN attached to the same Mikrotik router
  • Ensure devices on both LANs use the Mikrotik router as a DHCP server
  • Ensure devices on both LANs can contact each other
  • RECOMMENDED GRADING CRITERIA
    • Screenshot of GNS3 Environment
    • Screenshot of an end device on the first LAN receiving an IP address
    • Screenshot of an end device on the second LAN receiving an IP address
    • Screenshot of a device on one LAN pinging a device on the other LAN
Figures for the Printed Version
Picture of commands
Figure 4 – DHCP Server setup wizard

License

Icon for the Creative Commons Attribution 4.0 International License

Mastering Enterprise Networks Copyright © 2024 by Jacob Christensen is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book