Friday, May 31, 2024

Cisco 124 - DHCP

DHCP D-O-R-A


Discover    Client --> Server    Broadcast
Offer        Server --> Client    Broadcast or Unicast
Request        Client --> Server    Broadcast
Ack            Server --> Client    Broadcast or Unicast


R1(config-if)#ip helper-address <ip-addr>
^ Configures router as a DHCP relay agent.
Notice that you are on a specific interface when you do this.

R1(config-if)#ip address dhcp
^ Configures router as a DHCP client (umm... rare.)
Again, notice you are on a specific interface when you do this.

To config router as a DHCP server:


R1(config)#ip dhcp excluded-address low-address high-address
^ Cisco is weird.  You start by defining addresses you want to *exclude* from the range of available addresses.  I guess the idea is that it just automatically hands all the addresses on a subnet out unless you exclude them.

Ohhhh... I guess this is because we don't actually activate the lease.  I'll bet it's live as soon as it is defined.  So you have to first exclude the range before you create it.

R1(config)#ip dhcp pool <pool-name>
^Define a pool-name like LAB_POOL

R1(config)#network <ip-address> {/prefix-length | subnet-mask}
^This carves out a range of IP addresses to hand out (minus the ones that were excluded)

R1(config)#dns-server <ip-address>
^Config the scope for a specific DNS server.

R1(config)#domain-name <domain-name>
^Config scope with a domain name like jeremy.com

R1(config)#default-router <ip-address>
^Config scope for a specific default router

R1(config)#lease {days hours minutes | infinite}
^Define the lease length


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]