This lab only focuses on DHCP, you will need to begin with connectivity, which a good review as well. Before configuring the DHCP steps configure the topology to get connectivity throughout. You should be able to ping from the G0/0/1 interface on Branch to all other interfaces, you will not be able to ping from the PC as it doesn’t have its addressing information yet. You should configure IPv4 and IPv6 static default routes for routing, an example is below of the commands. We use Cisco 4331 routers and 2960, 3650, or 1300 switches, you can use Packet Tracer for the lab.
R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2
Enable IPv6 routing
R1(config)#ipv6 unicast-routing
R1(config)# ipv6 route ::/0 201:db8:1::2
Configure IPv4 DHCP on R1 to provide addressing to both PC1 and PC2
DHCPv4 for R1 side of the network – excluding addresses 10.10.1.1 to 10.10.1.5 and 10.10.1.254 from being given out to devices from the pool. We exclude address that we plan to use for static addressing, for example servers. The names of the DHCP pools are R1netpool and R2netpool
- R1(config)# ip dhcp excluded-address 10.10.1.1 10.10.1.5
- R1(config)# ip dhcp excluded-address 10.1.254
- R1(config)# ip dhcp pool R1netpool
- R1(dhcp-config)# network 10.10.1.0 255.255.255.0
- R1(dhcp-config)# dns-server 8.8.8.8
- R1(dhcp-config)#domain-name even.com
- R1(dhcp-config)# default-router 10.10.1.1
DHCPv4 for the R2 side of the network. Here we didn’t exclude any addresses.
- R1(config)# ip dhcp pool R2netpool
- R1(dhcp-config)# network 10.20.1.0 255.255.255.0
- R1(dhcp-config)# dns-server 8.8.8.8
- R1(dhcp-config)#domain-name even.com
- R1(dhcp-config)# default-router 10.20.1.1
DHCP helper address. Recall that routers don’t forward broadcasts and DHCP operation uses broadcasts, this means that DHCP requests from the R2 side (in our case only PC2 unless you added more PCs to the topology) won’t get to the DHCP server on R1 without some help. That help is to provide the address of the DHCP server on R2 then the requests can be sent directly to the server.
• R2(config)# int g0/0/1
• R2(config-if)# ip helper-address 192.168.1.1
You’ve completed IPv4 DHCP for the two networks now you could check the PC to see if it got its addressing information, you may need to renew the address information and make sure the PCs are set to get their addressing information automatically.
Configure Stateless DHCPv6 on R1 and Stateful DHCPv6 on R2
In this section we could have configured DHCPv6 only on R1 as we did with IPv4 DHCP but instead to show two different ways to configure DHCPv6 we configure in one way on each router, on R1 we’ll configure stateless DHCPv6 to provide IPv6 addressing to PC1 and on R2 we’ll configure stateful DHCPv6 to provide IPv6 addressing to PC2.
Stateless DHCPv6
Configure the stateless server –
• R1(config)# ipv6 dhcp pool stateless6
• R1(config-dhcpv6)# dns-server 2001:4860:4860::8888
• R1(config-dhcpv6)# domain-name even.com
Apply the server to the LAN interface and set the O flag to allow the host to get non-address information through stateful autoconfiguration.
• R1(config)# int g0/0/1
• R1(config-if)#ipv6 nd other-config-flag
• R1(config-if)# ipv6 dhcp server stateless6
Stateful DHCPv6
Configure the stateful server –
- R2(config)# ipv6 dhcp pool stateful6
• R2(config-dhcpv6)# Address prefix 2001:db8:20::/64
• R2(config-dhcpv6)# dns-server 2001:4860:4860::8888
• R2(config-dhcpv6)# domain-name even.com
Apply the server to the LAN and set the flags to tell the hosts not to use stateless autoconfig and to use the DHCPv6 server to get all its addressing information.
• R2(config)#int g0/1
• R2(config-if)# ipv6 nd managed-config-flag
• R2(config-if)# ipv6 nd prefix default no-autoconfig
• R2(config-if)# ipv6 dhcp server stateful6
Now you can verify you PCs got IPv6 addressing information. Router commands to check the servers on the router – show ipv6 dhcp pool and show ipv6 dhcp pool