DHCP

You might also like

Download as pdf
Download as pdf
You are on page 1of 29
atfuettae cisco Chapter 10: Chas Routing and Switching Essentials Cisco | Networking Academy* Mind Wide Opert Introduction Introduction = Dynamic Host Configuration Protocol (DHCP) is a network protocol that provides automatic IP addressing and other information to clients:IP address Subnet mask (IPv4) or prefix length (IPv6) Default gateway address DNS server address = Available for both IPv4and IPv6 = This chapter explores the functionality, configuration, and troubleshooting of both DHCPv4 and DHCPv6 DHCPv4 Operation Introducing DHCP v4 = DHCPv4 uses three different address allocation methods Manual Allocation - The administrator assigns a pre-allocated IPv4 address to the client, and DHCPv4 communicates only the IPv4 address to the device. Automatic Allocation - DHCP v4 automatically assigns a static IPv4 address permanently to a device, selecting it from a pool of available addresses. No lease. Dynamic Allocation - DHCPv4 dynamically assigns, or leases, an |Pv4 address from a pool of addresses for a limited period of time chosen by the server, or until the client no longer needs the address. Most commonly used. DHCPv4 Operation Introducing DHCP v4 DHCPv4 Operation a Lease Origination B ‘Server Client DHCPDISCOVER Broadcast would like to request an address.” am DHCPsw1. Here is an add! DMCPOFFER can ofr Unicast “Laccept the IP address offer. DHCPREQUEST ane ater oe crocdeast DHCPACK "Your acceptance is acknowledged. Minast — MMREK) YO" ooeptree s earoweroo” DHCPv4 Operation DHCPv4 Message Format DHCPv4 Message Format (OP Code (1) lartware type 1) | Har@vare address length Hardware type (1 a Hops (1) (CIADDR) -4 bytes ‘Your IP Address (YIADDR) - 4 bytes Server IP Address (SIADDR)- 4 bytes Gateway IP Address (GIADDR) -4 bytes Client Hard {dross (CHADDR) - 16 bytes ‘Server name (GNAME) - 64 bytes Boot Filename - 128 bytes DHCP Options - variable DHCPv4 Operation DHCPv4 Discover and Offer Messages DHCPv4 Discover Message 2 DHCPV4 Cliont A DHCP v4 Server P77 192.168.1.284/24 Ethornet Frame iP upp DHCPDISCOVER capo: 0.00.0 BRC MAC: NACA He src: o0.00 oper [SuooR 0000 Mask: 0.0.0.0, MACFRFRFRFRFRFE |DST.255.296 255.255 Te MAC: Media Accoss Control Address CCIADDR: Cliont IP Addross GIADDR: Gateway IP Addross CHADDR: Client Hardware Addross ‘The DHCP client sends a directed IP broadcast with a DHCPDISCOVER packet. In this example, the DHCP server Is on the same segment and will pick up this request, The server nates the GIADDR fied is blank; therefore, the client is on the same segment. The server also notes the hardware address of the client in DHCPv4 Operation Configuring a DHCPv4 Server = A Cisco router running Cisco IOS software can be configured to act as a DHCPV4 server. To set up DHCP. 1.Exclude addresses from the pool. 2. Set up DHCP pool name 3. Configuring Specific Tasks —define range of addresses and subnet mask. Use default-router command for default gateway. Optional items that can be included in pool — dns server, domain-name J¥ ip dhep excluded-address 192,168.10.1 192.168.10.9 14 4p ancp excluded-addresn 192.168.10.254 1# 4p dncp pool LaN-POOt-1 1G)# network 192.168.10.0 255.255,258.0 1g)4 default-router 192.168.10.1 # dne-server 192.168.11.5 = To disable dhcp - no service dhcp DHCPv4 Operation Verifying a DHCPv4 Server = Commands to verify DHCP show running-contig | section dhcp show ip dhcp binding show ip dhcp server statistics = On the PC —issue the ipconfig /all command eee Eee [oraror a aaannRNnEREENS DHCPv4 Operation DHCPv4 Relay = Using an IP helper address enables a router to forward DHCPv4 broadcasts to the DHCPv4 server. Acting as a relay. Ri(config)# interface g0/0 it) ip helper-address 192.168.11.6 £)4 end Rif show ip interface g0/0 GigabitEthernet0, , line protecol is up 2.168.10.1/24 address is 255.255.255.255 Addreas determined by setup command MTU is 1500 bytes Helper address is 192.168.11.6 Configuring a DHCPv4 client Configuring a Router as DHCPv4 client SOHO ISP SOKO (config) # interface g0/1 SOHO (config-if)# ip address dhcp SOHO (config-it)# no shutdown SOHO (config-if)+ oan 31 17:31:11,507: $pRCP-6-aD0: GigabitEthernet0/1 assigned DACP address 209.165.201.12, mask 255.259.255.224, hostname SOHO SOHO (config-if)$ end OF show ip interface g0/1 GigabitBthernst0/1 is up, Line protocol is up Internet address is 209,165.201.12/27 Broadcast address is 255.255.255.255 Address determined by DECP ASSIGN: Interface Troubleshoot DHCPv4 Troubleshooting Tasks Troubleshooting Task 1 Resolve conflicts. Troubleshooting Task 2 Verify physical connectivity Troubleshooting Task 3: Test with a static IPv4 address. Troubleshooting Task 4: Verify switch port configuration. Troubleshooting Task 5: Test fram the same subnet or VLAN Troubleshoot DHCPv4 Verify Router DHCPv4 Configuration Verifying DHCPv4 Relay and DHCPv4 Services Ri# show running-config | section interface GigabitEthernet0/0 interface GigabitEthernet0/0 ip address 192.168.10.1 255.255.255.0 ip helper-address 192.168.11.6 duplex auto speed auto Ri¢ Ri# show running-config | include no service dhcp Ri¢ Troubleshoot DHCPv4 Debugging DHCPv4 Verifying DHCPv4 Using Router debug Commands Ri (config) access-list 100 permit udp any any eq 67 Ri (config) # access-List 100 permit udp any any eq 68 Ri (config) # end debug ip packet 100 P packet debugging is on for *IP: 8=0.0.0.0 (GigubitEthernet0/1), d=25 0 +255.255.255, len 333, as list 0.0.0 (GigabitEthernet0/1), d=255.255.255.255, len 333, rocess pak for forus packet 92.168.11.1 (local), d=255.255.255.255 ernet0/1), Len 328, sending broad/multicast P. (Gigabit Routerlt debug ip dhcp server events DECPD: returned 192.168,10.11 to address pool LAN-POOL-1 DECPD: assigned IP address 192.168.10.12 to client 0100.0103. 8569.87. DECPD: checking for expired leases. DECED: the lease for address 192.168.10.10 has expired. DECPD: returned 192.168.10.10 to address pool LAN-POOL-1 SLAAC and DHCPv6 Stateless Address Autoconfiguration (SLAAC) SLAAC is a method in which a device can obtain an IPv6 global unicast address without the services of a DHCPV6 server. ICMPVé6 Stateless Address Autoconfiguration IPvé all-routers multicast Router Solicitation (RS) "Ineed a Router Advertisement from the router.” IPV6 all-nodes multicast (RA) fix-length and other information. SLAAC and DHCPv6 SLAAC Operation Client Performs Duplicate Address Detection IPv6 all-routers multicast 41. Router Solicitation "Ineed a Router Advertisement from the router.” 2, Router Advertisement IPV6 all-nodes multicast "Hore fs your prefix, prefixlangth and other information.” 3. Create IPv6 Global Unicast Address. After generating my oun interface ID | can use the prefix and prefix length from the router to create my own IPv6 address." IPv6 solicited-node multicast 4. Duplicate Address Detection "Are there any other devices on this network using this IPv8 address?" SLAAC and DHCPv6 SLAAC and DHCPv6 SLAAC and DHCPv6 Sor eo 1. Router Solicitation “\ need @ Rode Advertooment rom the ruts.” SLAAC Only (Default) 2 Router Advertisement Only usm the iformation in his RA message” Stateloss DHCPv6: SLAC and DHCPVé RA Message 2. Router Advertisement options ‘Las eformeton nis RA messape an cian sonal inomon fom a ‘Stateful DHCPv6: DHCPv6 Only 2. Router Advertisement “Donot uso te information a his RA message, Obtain al formation fom a DHCP Ve corer” SLAAC and DHCPv6 SLAAC Option Router Solicitation The RA message <——c e®mmmswy eariaies ai ee addressing information | need. There is no other Router Advertisement information available @ M flag = 0/0 flag = 0 7 from a DHCP v6 server. ees © a i ert SLAAC and DHCPv6 Stateless DHCP Option joo DHCPV6 Server ithe RA message has some of the faddressing information | need, but | need to contact a DHCPv6- server for other configuration information such as DNS server addresses. Router Solicitation, o Router Advertisement So Miflag = 0/ 0 flag = 0 © DHCPv6 operations SLAAC and DHCPv6 Stateful DHCP Option jso0 DHCP v6 Server E}The RA message tells me that | eed to contact a DHCPY6 server for all my addressing information Router Sotctatongy Router Advertisement @ " Mflag = 1 oO DHCPy6 operations i 8 eS SLAAC and DHCPv6 DHCPv6 Operations ei SLAAC Operations Router Soictaton gy Qa eat © SOLICIT To all DHCPV6 Servors ADVERTISE Usicee gy REQUEST or INFORMATION REQUEST Unicast REPLY Unicast © Stateless DHCPv6 Configuring a Router as a Stateless DHCPv6 Server Go CO DHCPvé6 Stateless Server DHCPVé6 Client Ri (config) ipv6 unicast-routing Ri(config)# ipvé dhep pool IPV6-STATELESS v6) # dns-server 2001:db8:cafe:aaaa: 176) * domain-name example.com Ri (config-dhcpv6) # exit Ri(config)# interface g0/1 Ri (config-if)# ipw6 address 2001:db8:cafe:1::1/64 Ri(config-if)+ ipw6 dhcp server IPV6-STATELESS Ri (config-if)# ipw6 nd other-config-flag Stateless DHCPv6 Configuring a Router as a Stateless DHCPVv6 Client oe— “99 Stateless DHCPv6 Server DHCPvé6 Client R3 (config) # interface g0/1 R3 (config-if)# ipv6 enable R3 (config-if)# ipv6 address autoconfig R3 (config-if) # = Verify the Stateless DHCP Client using: Show IPV6 interface Debug ipvé dhcp detail Stateful DHCPv6 Configuring a Router as a Stateful DHCPv6 Server Gt DHCPVé6 Stateful Server DHCPvé6 Client Gon Ri(config)# ipv6 unicast-routing Ri (config) # ipv6 dhcp pool IPV6-STATEFUL Ri (config-dhcpvé)# address prefix 2001:DB8:CAFE:1::/64 lifetime infinite infinite pv6)# dns-server 2001:db8:cafe:aaaa: :5 Ri (config-dhcpv6) # domain-name example.com Ri (config-dhcpvé) # exit Ri (config)# interface g0/1 Ri (config-if)# ipv6 address 2001:db8:cafe:1::1/64 Ri (config-if)# ipv6 dhep server IPV6-STATEFUL Ri (config-if)¥# ipv6 nd managed-config-flag Ri (config-dh Stateful DHCPv6 Configuring a Router as a Stateful DHCPv6 Client Gor corr Stateful DHCPV6 Server DHCPv6 Client 3 (config) interface g0/1 3 (config-if) ipv6 enable R3 (config-if)+ ipv6 address dhop R3 (config-if)+ Verify Stateful DHCPv6 Server using: show ipv6 dhcp pool show ipv6 dhcp binding Verify Stateful DHCPvé6 client using: show ipv6 interface Stateful DHCPv6 Config a Router as a Stateful DHCPv6 Relay Agent Troubleshooting DHCPv6 Troubleshooting Tasks Troubleshooting Task 1: Resolve conflicts. Troubleshooting Task 2: Verify allocation method Troubleshooting Task 3 Troubleshooting Task 4: Verify switch port configuration Troubleshooting Task 5: Test from the same subnet or VLAN. Troubleshooting DHCPv6 Verify Router DHCPv6 Configuration )# ipw6 dhop pool IPV6-STATEFUL ‘Ri (config-dhepv6)# address prefix 2001:DB8:CAFE:1::/64 lifetime infinite infinite Ri (config-dhcpv6)# dns-server 2001:db8:cafe Ri (config-dhcpv6)# domain-name example.com R1(config-dhcepv6)# exit Ri (config) interface g0/1 Ri (con )4 ipv6 address 2001:db8:cafe:1::1/64 Ri (config-if)# ipv6 dhcp server IPV6-STATEFUL Ri (config-if)¥ ipv6 nd managed-config-flag Stateless DHCPV6 Services Ri (config) ipv6 unicast-routing Ri (config) ipv6 dhcp pool IFV6-STATELESS Ri (config-dhepy6)# dns-server 2001:db8:cafe Ri (config-dhcpv6)# domain-name example.com 1 (config-dhepv6)# exit )# interface g0/1 )4 ipv6 address 2001:db8:cafe )4 ipvé dhcp server IPV6-STATELESS Ri (config-if)# ipv6 nd other-config-flag 164 Troubleshooting DHCPv6 Debugging DHCP v6 Rif debug ipvé dhcp detail TPv6 DHCP debugging is on (detailed) Rit *Feb 3 21:27:41.123: EPW6||DHCBY| [Received |SonTCr®| from FEQ01?32F7:DFF:FE25:2PE1 on Cigabitethernet0/1 ‘Feb 3 21:27:41.123: IPv6 DHCP: detailed packet contents Reb 3 21:27:41.123: (sigabitetherneto/1) #reb 3 21:27:41,127: dst: FFO2:: *reb 3 21:27:41.127: type SOLICIT(1), xid 13190645 Feb 3 21:27:41.127: option SLAPSED-TIm(a), len 2 Feb 3 21:27:41,127: elapsed-time 0 Feb 3 21:27:41.127: option CLIENTID(1), len 10 treb 3 21:27:41,127 000 ‘Feb 3 21:27:41.127: IBV6)DACP?/ Using |interface||pool!/TPv6> STATEFUL ‘Feb 3 21:27:41,127: TeV6| DHCP? (Creating binding|for FESO: :32F7:DFF:FE25:2DE1 in pool IPV6-STATEFUL Cisco | Networking Academy* Mind Wide Open”

You might also like