Answers: Local DHCP Server 1

Today’s lab lets you configure a local DHCP on a router, and work through all the small settings. You know the drill – read the original lab post first, and then come back here.
Answers
Figure 1: ROAS with two VLAN’s (CL124.jpg)
Example 3: R1 Config
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
ip dhcp excluded-address 192.168.100.1 ip dhcp excluded-address 192.168.200.1 ! ip dhcp pool One network 192.168.100.0 255.255.255.0 default-router 192.168.100.1 domain-name example.com dns-server 10.1.1.1 10.1.1.2 lease 7 ! ip dhcp pool Two network 192.168.200.0 255.255.255.0 default-router 192.168.200.1 domain-name example.com dns-server 10.1.1.1 10.1.1.2 lease 7 |
Commentary
The configuration of DHCP for locally attached devices is reasonably simple. You must know the interface that is connecting to the devices who need addressing and the IP address configured on that router interface. This information is all that is required to assign an IP address to a host and allow them to send traffic off of their local network.
For this lab, you were tasked with configuring R1 to act as a DHCP server for two connected LANs, the first which was connected off of VLAN 10 and the second which was connected off of VLAN 20. You were also asked to assign the appropriate gateway address to each device.
The DHCP server configuration requires two different DHCP pools because two different subnets will each use different default gateway settings. The requirements state that the pools should be called One and Two. The command to create a new or configure an existing DHCP pool is ip dhcp pool pool-name. To create the first DHCP pool use the ip dhcp pool One command, this will place you into DHCP pool configuration mode; it is in this mode where you configure the options to be issued to the client.
Both pools need a network command to define the range of addresses that the DHCP server could assign from the pool, along with defining the default gateway address with the default-router command. Pool One defines the first network (192.168.100.0/24), with default router 192.168.100.1. Pool 2 similarly defines network 192.168.200.0/24, with default router 192.168.200.1. Note that both default router IP addresses are then excluded from being assigned to clients with two global commands at the top of the example.
Both pools use the same settings for the domain name, DNS server, and lease time in this case.
Note that when configuring a DHCP server that only services devices that are directly connected, the ip helper-address command is not required.
Is the Lease correct? should it not be lease 7 0 0 or lease 7
Hi Dobo,
Yep. The original posting of “lease 1” was incorrect. I edited it to be “lease 7” (which is allowed), meaning 7 days. Note that “lease 7 0 0” would be accepted and changed to “lease 7”. Thanks for letting me know!
Wendell
Trying this out in Packet Tracer. With a 2911, it looks like the domain-name and lease options are not available. Do the DHCP server options vary on different router models?
Hi Kevin,
I imagine it’s got more to do with PT than a router model. While there might be occasional diffs with command sets based on router models, due to hardware diffs, I wouldn’t expect them in something as software-centric as DHCP.
Wendell
Also using the 2911 in PT, the domain-name command is under the ip command in Global config mode, but cannot find the lease command at all
Jeremy,
If you’re referring to the “domain” command in global mode, that’s a different command than the “domain-name” command defined in DHCP pool mode as shown in the example here. FYI.
Wendell
For anyone else who stumbles across this, there are three commands in Packet Tracer that do not work for this lab. ‘dns-server’ only allows you to specify one DNS server, the ‘lease’ command doesn’t exist, and ‘domain-name’ command doesn’t exist.
You will need hardware or another virtualization platform to complete every step.
I have Packet Tracer v7.2.0
1. lease command doesn’t exist
2. domain-name command allows you to specify only one DNS server
3. all other commands are working just fine
Hi, Wendell how are you? Greetings.
I wanted to know if I configured properly the aditional activity you proposed in the section “Answer on Paper, or Maybe Test in Lab”, about the management of switches that lease ip addresses (I made a simplier version of it, the same topology of the exercise and SW1 manageable only).
I defined a interface vlan 1 in SW1:
SW1(config)#interface vlan 1
SW1(config-if)#ip address dhcp
SW1(config-if)#no shutdown
And in the router, another pool had to be added:
R1(config)#ip dhcp excluded-address 192.168.99.1
R1(config)#ip dhcp pool SW-Admin
R1(dhcp-config)#network 192.168.99.0 255.255.255.0
R1(dhcp-config)#default-router 192.168.99.1
R1(dhcp-config)#exit
Given that I defined vlan 1 for SW1’s administration and that’s the default native vlan, I configured the ip address for that subnet in the main g0/1 interface, and no in g0/1’s subinterfaces, that have tagged traffic of vlans 10 and 20:
R1(config)#int g0/1
R1(config-if)#ip address 192.168.99.1 255.255.255.0
R1(config-if)#exit
Is this part ok? Thanks in advance.
Marcelo,
Perfect! And logically presented. (That’s always a big help on my end.) Looks good!
Did the switch lease it’s address?
Wendell
We don’t need relay agent or the dhcp server resids on two subnet at the same time !!!
Abdelghani,
Correct – no relay agent is required. The IOS DHCP server examines all incoming messages sent with UDP to DHCP well-known port 68, in this case supporting requests entering both LAN interfaces.
Don’t use a 4331 Router because it does not allow you to configure lease time (at least not in Packet Tracer 8.2)