Lab Objective
Configure CHAP authentication between two routers using the straightforward method of matching usernames and passwords, verify the challenge-response exchange completes successfully, and observe a mismatched-secret failure.
Lab Purpose
Unlike PAP, covered in the previous lab, CHAP never sends the actual password across the link — it uses a challenge-response mechanism based on a shared secret, making it significantly more resistant to interception. This is the reason CHAP is strongly preferred over PAP in virtually all real-world deployments.
Lab Topology
R1 ---- Serial0/0/0 (DTE) ------ Serial0/0/0 (DCE) ---- R2
R1: 10.12.12.1/30
R2: 10.12.12.2/30
Both routers already run PPP encapsulationTask 1: Configure Matching Usernames and Passwords
On each router, create a local username matching the OTHER router's hostname, with both routers using the identical secret password.
Task 2: Enable CHAP Authentication
Enable CHAP authentication on both routers' serial interfaces.
Task 3: Verify the Challenge-Response Exchange
Use debug output to observe the CHAP challenge and response messages exchanged between the two routers.
Task 4: Verify Connectivity
Confirm the link authenticates successfully and IP connectivity works.
Task 5: Introduce a Secret Mismatch
Change the password in R1's local username entry for R2 without updating R2's matching entry, and observe the resulting failure.
Solution and Verification
R1(config)# username R2 password SharedSecret1
R1(config)# interface serial0/0/0
R1(config-if)# encapsulation ppp
R1(config-if)# ppp authentication chapR2(config)# username R1 password SharedSecret1
R2(config)# interface serial0/0/0
R2(config-if)# encapsulation ppp
R2(config-if)# ppp authentication chapR1# debug ppp authentication
PPP Serial0/0/0: Send CHAP challenge id=1
PPP Serial0/0/0: CHAP challenge from R2
PPP Serial0/0/0: CHAP response received from R2
PPP Serial0/0/0: remote passed CHAP authentication
-- Note: no password ever appears in this
-- exchange -- only a challenge and a hashed
-- response computed from the shared secret,
-- fundamentally different from PAP's plain-text
-- exchange covered in the previous labR1# show interfaces serial0/0/0
Serial0/0/0 is up, line protocol is up
R1# ping 10.12.12.2
!!!!!
Success rate is 100 percent (5/5)R1(config)# username R2 password DifferentSecret
R1# show interfaces serial0/0/0
Serial0/0/0 is up, line protocol is down
R1# debug ppp authentication
PPP Serial0/0/0: CHAP response received from R2
PPP Serial0/0/0: remote FAILED CHAP authentication
-- The hash R1 computes using its own stored
-- secret no longer matches what R2's response
-- expects, since R1's local copy of the secret
-- changed while R2's did notR1(config)# username R2 password SharedSecret1
R1# show interfaces serial0/0/0
Serial0/0/0 is up, line protocol is upKey Takeaway
With this matching-username method, both routers must store the identical secret under a username matching the OTHER router's hostname — CHAP's security comes from never transmitting this secret directly, but this also means both sides' locally stored copies must always remain perfectly synchronized, since there is no way to simply "resend" a forgotten password as PAP effectively allows.