GNS3 Lab: Vlans and DHCP Server

For this Lab, I configured a DHCP Server (Windows 2016) and VLANs (10 and 20). The Server assigns IP addresses to the devices connected to the network depending on the VLAN it is on. For my topology, I have two VLANs 10 and 20. The following is a summary of my documentation.

DHCP Server

The server for the lab is Windows 2016 which has an IP address of 172.16.50.1. In the Operating system, I added the DHCP role through the system dashboard. After setting up DHCP I added two scopes:

  1. 192.162.10.254 for VLAN 10
  2. 192.168.20.254 for VLAN 20

While setting up these scopes you can choose the range for example: 192.162.10.1 to 192.162.10.100. You also exclude IP addresses that you don't want to be advertised. And also set the Default Gateway.

image
image

Switch Configuration

In order for the end devices on different VLANs to be assigned an IP address a DHCP Relay needs to be configured on this switch SW for this lab. The switch has an interface VLAN 10 and VLAN 20 configured using:

  • IP address-helper 172.16.50.1 (you should use your DHCP server IP address)

End Devices

After configuring the DCHP Server and the DHCP Relay address on the switch. Depending on the VLAN that the device is connected it will be assigned an IP address. For the lab, there are 2 VLANs 10 and 20.

The end devices PC1 and PC2 are connected in different VLANs 10 and 20.

image
image

PC 1

From the terminal of PC1 when I request an IP it is assigned 192.168.10.100. It also shows the Gateway, DNS, DHCP Server, and the Domain Name of the server.

PC2

Same also for PC2 connected on VLAN 20. You can also see the DHCP exchange DORA(Discover Offer Request Acknowledge) by examining the network through Wireshark.

image
image

To configure such a lab you need to know routing protocols like Static, OSPF, EIGRP, or BGP  for the routers to see your routes. For this lab, I used some Static Routes, OSFP, and BGP Protocol. I also used NAT for the EDGE-R and ISP routers.