DHCP with Packet Tracer (NET 330) - Chromosom3/TechNotes GitHub Wiki
DHCP with Packet Tracer
Intro to Lab
This wiki entry will cover lab 3-3 DHCP Server in Packet Tracer and lab 4-1 Small Enterprise-Class Lab. Since lab 4-1 builds off of 3-3 I will primarily focus on 4-1.
The environment for this lab is shown below.
Subnet Name | VLAN ID | Hosts Needed | Hosts Available | Subnet Mask / CIDR | Usable Range | Gateway Address |
---|---|---|---|---|---|---|
Clinic | 20 | 300 | 510 | 255.255.254.0 /23 | 10.16.0.1 - 10.16.1.254 | 10.16.0.1 |
Visitor | 30 | 300 | 510 | 255.255.254.0 /23 | 10.16.2.1 - 10.16.3.254 | 10.16.2.1 |
Office | 40 | 300 | 510 | 255.255.254.0 /23 | 10.16.4.1 - 10.16.5.254 | 10.16.4.1 |
Default | 1 | 150 | 254 | 255.255.255.0 /24 | 10.16.6.1 - 10.16.6.254 | 10.16.6.1 |
Counseling | 50 | 150 | 254 | 255.255.255.0 /24 | 10.16.7.1 - 10.16.7.254 | 10.16.7.1 |
Network Diagram
Configuring Switches
Though this section is titled Configuring Switches I will also cover how to configure a layer three switch as the gateway for the network. The switch used as a gateway was a Cisco 3560 24 PS.
VLANs
Since VLANs were covered in the last entry I will only be putting the commands used with a short description of what they do.
The following will create a VLAN with the specified ID and then set a name for the VLAN.
vlan 20
name Clinic
vlan 30
name Visitor
vlan 40
name Office
vlan 50
name Counseling
The above commands were run on all of the 2960-24TT switches and on the 2560-24PS.
The following commands were run on all the 2960-24TT switches to set access ports for client machines. Note the 3560-24PS did not have any access ports configured as it was only connected to other switches using trunk ports.
interface range fa 0/5-11
switchport access vlan 20
interface range fa 0/12-15
switchport access vlan 30
interface range fa 0/16-21
switchport access vlan 40
As mentioned the switches were connected to each other via trunk ports. To do this the following command needed to be run on a switch. Note for this example the interface fa 0/24 was used. This will need to be changed to the interface you want to set as a trunk port.
interface fa 0/24
switchport trunk encapsulation dotlq
switchport mode trunk
Note depending on the switch the second line may not be needed.
Since the default VLAN (1) was being used we need to enable it. By default it is disabled.
interface vlan 1
no shutdown
Gateway settings
The following commands were only run on the 3560-24PS switch. These commands set the IP addresses for the gateway on the VLANs.
interface vlan 20
ip address 10.16.0.1 255.255.254.0
interface vlan 30
ip address 10.16.2.1 255.255.254.0
interface vlan 40
ip address 10.16.4.1 255.255.254.0
interface vlan 1
ip address 10.16.6.1 255.255.255.0
interface vlan 50
ip address 10.16.7.1 255.255.255.0
Next, let's set up routing on the interfaces. To do this run the following command.
ip routing
Now we need to configure IP helpers for the DHCP server. The IP 10.16.6.2 is for the DHCP server in this environment.
interface vlan 20
ip helper-address 10.16.6.2
interface vlan 30
ip helper-address 10.16.6.2
interface vlan 40
ip helper-address 10.16.6.2
interface vlan 50
ip helper-address 10.16.6.2
DHCP
Finally, we will want to configure a server on the network to provide DHCP. For this select End Devices then Server and connect it in the network. Select the server then go to services. From there go to DHCP and configure as seen below.
To create a new pool simply start working on one and then select add (not save, save will override the current one). The serverPool pool can not be deleted.
Notes
Under preferences in Packet Tracer, you can check always show port labels in logical workspaces to see all the ports in use on the network. This is shown in the picture below.