Lab Objective
Configure CHAP authentication between two routers using the interface-level ppp chap hostname and ppp chap password commands instead of the local username database method covered in the previous lab, and verify the resulting authentication succeeds.
Lab Purpose
The matching-username method from the previous lab works well for a single point-to-point link, but becomes unwieldy on a router with dozens of serial interfaces, each needing a different username entry for a different peer. The ppp chap hostname and ppp chap password commands configure the identity presented on a per-interface basis, avoiding the need for a large, centrally managed username database entry per peer.
Lab Topology
R1 ---- Serial0/0/0 (DTE) ------ Serial0/0/0 (DCE) ---- R2
R1: 10.13.13.1/30
R2: 10.13.13.2/30
Both routers already run PPP encapsulationTask 1: Configure Interface-Level CHAP Identity on R1
On R1's serial interface, configure a specific CHAP hostname and password to present during authentication, rather than relying on R1's actual system hostname.
Task 2: Configure Interface-Level CHAP Identity on R2
On R2's serial interface, configure a matching CHAP hostname and password that R1 will expect to receive.
Task 3: Enable CHAP Authentication
Enable CHAP authentication on both serial interfaces.
Task 4: Configure the Expected Username Entries
On each router, create a local username entry matching the CHAP hostname the OTHER router will present, with the shared password.
Task 5: Verify Authentication Succeeds
Confirm the link comes up and IP connectivity works.
Solution and Verification
R1(config)# username BranchB password SharedKey99
R1(config)# interface serial0/0/0
R1(config-if)# encapsulation ppp
R1(config-if)# ppp chap hostname BranchA
R1(config-if)# ppp chap password SharedKey99
R1(config-if)# ppp authentication chapR2(config)# username BranchA password SharedKey99
R2(config)# interface serial0/0/0
R2(config-if)# encapsulation ppp
R2(config-if)# ppp chap hostname BranchB
R2(config-if)# ppp chap password SharedKey99
R2(config-if)# ppp authentication chapR1# debug ppp authentication
PPP Serial0/0/0: CHAP challenge from BranchB
PPP Serial0/0/0: CHAP response received from BranchB
PPP Serial0/0/0: remote passed CHAP authentication
-- Notice the identity exchanged is "BranchB",
-- the configured CHAP hostname, rather than
-- R2's actual system hostname -- this is
-- exactly the flexibility this method providesR1# show interfaces serial0/0/0
Serial0/0/0 is up, line protocol is up
R1# ping 10.13.13.2
!!!!!
Success rate is 100 percent (5/5)Key Takeaway
The ppp chap hostname command overrides what identity a specific interface presents during CHAP negotiation, decoupling it from the router's actual system hostname — this becomes essential on a hub router with many spoke connections, since it allows each individual interface to present a distinct identity matching whatever username entry that specific peer expects, without renaming the entire router.