PPP Authentication (3.3.2)
PPP authentication protocols and configuration of PPP authentication is discussed in this section.
PPP Authentication Protocols (3.3.2.1)
PPP defines an extensible LCP that allows negotiation of an authentication protocol for authenticating its peer before allowing network layer protocols to transmit over the link. RFC 1334 defines two protocols for authentication, PAP and CHAP, as shown in Figure 3-33.
Figure 3-33 PPP Authentication Protocols
PAP is a very basic two-way process. There is no encryption. The username and password are sent in plaintext. If it is accepted, the connection is allowed. CHAP is more secure than PAP. It involves a three-way exchange of a shared secret.
The authentication phase of a PPP session is optional. If used, the peer is authenticated after LCP establishes the link and chooses the authentication protocol. If it is used, authentication takes place before the network layer protocol configuration phase begins.
The authentication options require that the calling side of the link enter authentication information. This helps to ensure that the user has the permission of the network administrator to make the call. Peer routers exchange authentication messages.
Password Authentication Protocol (PAP)
One of the many features of PPP is that it performs Layer 2 authentication in addition to other layers of authentication, encryption, access control, and general security procedures.
Initiating PAP
PAP provides a simple method for a remote node to establish its identity using a two-way handshake.
use global configuration mode command username user_name password pass_word
to configure a identity pair on the other router. PAP is not interactive. When the
ppp authentication pap
command is used, the username and password are sent as one LCP data package, rather than the server sending a login prompt and waiting for a response, as shown in Figure 3-34. After PPP completes the link establishment phase, the remote node repeatedly sends a username-password pair across the link until the receiving node acknowledges it or terminates the connection.
PPP pap sent-username <username> password <password>
Enables outbound PAP authentication. The local router uses the username and password specified by the
ppp pap sent-username username password password
command to authenticate itself to a remote device.eg.
R2(coinfig-if) # ppp pap sent-username R2 password cisco
Figure 3-34 Initiating PAP
Completing PAP
At the receiving node, the username-password is checked by an authentication server that either allows or denies the connection. An accept or reject message is returned to the requester, as shown in Figure 3-35.
Figure 3-35 Completing PAP
PAP is not a strong authentication protocol. Using PAP, passwords are sent across the link in plaintext, and there is no protection from playback or repeated trial-and-error attacks. The remote node is in control of the frequency and timing of the login attempts.
Nonetheless, there are times when using PAP can be justified. For example, despite its shortcomings, PAP may be used in the following environments:
- A large installed base of client applications that do not support CHAP
- Incompatibilities between different vendor implementations of CHAP
- Situations where a plaintext password must be available to simulate a login at the remote host
Challenge Handshake Authentication Protocol (CHAP) (3.3.2.3)
After authentication is established with PAP, it does not reauthenticate. This leaves the network vulnerable to attack. Unlike PAP, which only authenticates once, CHAP conducts periodic challenges to make sure that the remote node still has a valid password value. The password value is variable and changes unpredictably while the link exists.
After the PPP link establishment phase is complete, the local router sends a challenge message to the remote node, as shown in Figure 3-36.
Figure 3-36 Initiating CHAP
The remote node responds with a value calculated using a one-way hash function, which is typically message digest 5 (MD5) based on the password and challenge message, as shown in Figure 3-37.
Figure 3-37 Responding CHAP
The local router checks the response against its own calculation of the expected hash value. If the values match, the initiating node acknowledges the authentication, as shown in Figure 3-38. If the value does not match, the initiating node immediately terminates the connection.
Figure 3-38 Completing CHAP
CHAP provides protection against playback attack by using a variable challenge value that is unique and unpredictable. Because the challenge is unique and random, the resulting hash value is also unique and random. The use of repeated challenges limits the time of exposure to any single attack. The local router or a third-party authentication server is in control of the frequency and timing of the challenges.
PPP Encapsulation and Authentication Process (3.3.2.4)
The flowchart in Figure 3-39 can be used to help understand the PPP authentication process when configuring PPP. The flowchart provides a visual example of the logic decisions made by PPP.
Figure 3-39 PPP Encapsulation and Authentication Process
For example, if an incoming PPP request requires no authentication, then PPP progresses to the next level. If an incoming PPP request requires authentication, then it can be authenticated using either the local database or a security server.
As illustrated in the flowchart, successful authentication progresses to the next level, while an authentication failure disconnects and drops the incoming PPP request.
PPP Authentication example
Step 1. As shown in Figure 3-40, R1 initially negotiates the link connection using LCP with router R2 and the two systems agree to use CHAP authentication during the PPP LCP negotiation.
Figure 3-40 Establishing a Link
Step 2. As shown in Figure 3-41, R2 generates an ID and a random number, and sends that and its username as a CHAP challenge packet to R1.
Figure 3-41 Sending a CHAP Challenge to R1
Step 3. As shown in Figure 3-42, R1 uses the username of the challenger (R2) and cross references it with its local database to find its associated password. R1 then generates a unique MD5 hash number using the R2’s username, ID, random number and the shared secret password.
In this example, the shared secret password is boardwalk.
Figure 3-42 R1 Validates R2
Step 4. As shown in Figure 3-43, Router R1 then sends the challenge ID, the hashed value, and its username (R1) to R2.
Figure 3-43 R1 Sends the Challenge to R2
Step 5. As shown in Figure 3-44, R2 generates its own hash value using the ID, the shared secret password, and the random number it originally sent to R1.
Figure 3-44 R2 Validates R1
Step 6. As shown in Figure 3-45, R2 compares its hash value with the hash value sent by R1. If the values are the same, R2 sends a link established response to R1.
Figure 3-45 R2 Establishes the Link
If the authentication failed, a CHAP failure packet is built from the following components:
- 04 = CHAP failure message type
- id = copied from the response packet
- “Authentication failure” or some similar text message, which is meant to be a user-readable explanation
The shared secret password must be identical on R1 and R2.
Configuring PPP Authentication (3.3.2.5)
To specify the order in which the CHAP or PAP protocols are requested on the interface, use the ppp authentication interface configuration command:
Router(config-if)# ppp authentication {chap | chap pap | pap chap | pap} [if needed] [list-name | default] [callin]
- Use the no form of the command to disable this authentication.
Table 3-7 explains the syntax for the ppp authentication interface configuration command.
Table 3-7 PPP Command Syntax
chap | Enables CHAP on serial interface. |
pap | Enables PAP on serial interface. |
chap pap | Enables both CHAP and PAP on serial interface, and performs CHAP authentication before PAP. So pap is the fallback. |
pap chap | Enables both CHAP and PAP on serial interface, and performs PAP authentication before CHAP. chap is the fallback |
if-needed (Optional) | Used with TACACS and XTACACS. Do not perform CHAP or PAP authentication if the user has already provided authentication. This option is available only on asynchronous interfaces. |
list-name (Optional) | Used with AAA/TACACS+. Specifies the name of a list of TACACS+ methods of authentication to use. If no list name is specified, the system uses the default. Lists are created with the aaa authentication ppp command. |
default (Optional) | Used with AAA/TACACS+. Created with the aaa authentication ppp command. |
Callin | Specifies authentication on incoming (received) calls only. |
After you have enabled CHAP or PAP authentication, or both, the local router requires the remote device to prove its identity before allowing data traffic to flow. This is done as follows:
- PAP authentication requires the remote device to send a name and password to be checked against a matching entry in the local username database or in the remote TACACS/TACACS+ database.
- CHAP authentication sends a challenge to the remote device. The remote device must encrypt the challenge value with a shared secret and return the encrypted value and its name to the local router in a response message. The local router uses the name of the remote device to look up the appropriate secret in the local username or remote TACACS/TACACS+ database. It uses the looked-up secret to encrypt the original challenge and verify that the encrypted values match.
Either PAP or CHAP or both can be enabled. If both methods are enabled, the first method specified is requested during link negotiation. If the peer suggests using the second method or simply refuses the first method, the second method should be tried. Some remote devices support CHAP only and some PAP only.
The order in which you specify the methods is based on your concerns about the ability of the remote device to correctly negotiate the appropriate method as well as your concern about data line security. PAP usernames and passwords are sent as plaintext strings and can be intercepted and reused. CHAP has eliminated most of the known security holes.
Configuring PPP with Authentication (3.3.2.6)
The procedure outlined in the table describes how to configure PPP encapsulation and PAP/CHAP authentication protocols. Correct configuration is essential, because PAP and CHAP use these parameters to authenticate.
Configuring PAP Authentication
Figure 3-46 shows the topology used in an example of a two-way PAP authentication configuration, with the configuration in the following listing. Both routers authenticate and are authenticated, so the PAP authentication commands mirror each other. The PAP username and password that each router sends must match those specified with the username name password password command of the other router.
Figure 3-46 Topology for PPP
Partial running-config for R1
hostname R1username R2 password sameone
//create a username and password for client to access local router. This command is issued in global configuration mode. ! interface Serial0/0/0 ip address 10.0.1.1 255.255.255.252 ipv6 address 2001:DB8:CAFE:1::1/64 encapsulation pppppp authentication pap
ppp pap sent-username R1 password sameone
//send the local router's credential to the remote router, issued in interface configuration mode.
Partial running-config for R2
hostname R2username R1 password sameone
! interface Serial 0/0/0 ip address 10.0.1.2 255.255.255.252 ipv6 address 2001:db8:cafe:1::2/64 encapsulation pppppp authentication pap
ppp pap sent-username R2 password sameone
PAP provides a simple method for a remote node to establish its identity using a two-way handshake. This is done only on initial link establishment. The hostname on one router must match the username the other router has configured for PPP. The passwords must also match.
Specify the username and password parameters, use the following command:
R1(config-if)# ppp pap sent-username name password password
.
Configuring CHAP Authentication
CHAP periodically verifies the identity of the remote node using a three-way handshake. The hostname on one router must match the username the other router has configured. The passwords must also match, which means two router’s password must be same. This occurs on initial link establishment and can be repeated any time after the link has been established. The following is an example of a CHAP configuration.
Partial running-config for R1
hostname R1username R2 password sameone
! interface Serial0/0/0 ip address 10.0.1.1 255.255.255.252 ipv6 address 2001:DB8:CAFE:1::1/64 encapsulation pppppp authentication chap
Partial running-config for R2
hostname R2username R1 password sameone
! interface Serial 0/0/0 ip address 10.0.1.2 255.255.255.252 ipv6 address 2001:db8:cafe:1::2/64 encapsulation pppppp authentication chap