CCNA - Hướng dẫn Cấu hình PPP với xác thực CHAP trong mạng WAN


Mô tả và yêu cầu:
CHAP là giao thức xác thực được xem là bảo mật hơn PAP vì không gửi Password clear text trên đường truyền.

- CHAP dùng thuật toán Hash MD5 để bảo vệ quá trình xác thực.
- Trong bài này dùng CHAP để xác thực giữa hai thiết bị.
- Sau khi cấu hình thì kiểm tra Ping giữa 2 Router R1 và R2
Lưu ý: Khác với PAP, password được sử dụng của thiết bị xác thực phải giống nhau:


Các bước thực hiện

Bước 1: Cấu hình trên R1 (Đặt hostname, cấu hình cho các cổng loopback, fastEthernet và Serial trên R1, R2)

Code: 
Router> en
Router# conf t
Router(config)# hostname R1
R1(config)# no ip domain-lookup

R1(config)#int s0/1
R1(config-if)#ip addr 192.168.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shut
R1(config-if)#exit

Bước 2: Cấu hình trên R2.


Code: 
Router> en
Router# conf t
Router(config)# hostname R2
R2(config)# no ip domain-lookup

R2(config)#int s0/0
R2(config-if)#ip addr 192.168.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
Bước 3: Kiểm tra trạng thái line trên các cổng.


Bước 4: Cấu hình PPP với xác thực CHAP trên Router R1 và R2

Code: 
R1(config)#username bknp password 123456a@
R1(config)#int s0/1
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication chap
R1(config-if)#ppp chap hostname cisco
R1(config-if)#ppp chap password 123456a@

R2(config)#username cisco password 123456a@
R2(config)#int s0/0
R2(config-if)#encapsulation ppp
R2(config-if)#ppp authentication chap
R2(config-if)#ppp chap hostname bknp
R2(config-if)#ppp chap password 123456a@
Kiểm tra:
- Nếu cả hai thiết bị xác thực thành công trạng thái line protocol trên cổng sẽ UP.

- Kiểm tra trường hợp xác thực sai, bằng việc thay đổi database nội bộ.
R2(config)#username cisco password bknp

- Mặc dù CHAP sẽ định kì trao đổi thông tin xác thực, nhưng để kiểm tra ta sẽ cần thiết bị tham gia xác thực lại
Code: 
R2(config)#int s0/0
R2(config-if)#shut
R2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
R2(config-if)#end
R2#debug ppp authentication
PPP authentication debugging is on
R2#
*Mar 1 00:47:20.531: Se0/0 CHAP: O CHALLENGE id 170 len 25 from "bknp"
*Mar 1 00:47:20.535: Se0/0 CHAP: I CHALLENGE id 85 len 26 from "cisco"
*Mar 1 00:47:20.539: Se0/0 CHAP: I RESPONSE id 170 len 26 from "cisco"
*Mar 1 00:47:20.547: Se0/0 PPP: Sent CHAP LOGIN Request
*Mar 1 00:47:20.551: Se0/0 CHAP: Using hostname from interface CHAP
*Mar 1 00:47:20.551: Se0/0 CHAP: Using password from AAA
*Mar 1 00:47:20.551: Se0/0 CHAP: O RESPONSE id 85 len 25 from "bknp"
*Mar 1 00:47:20.559: Se0/0 PPP: Received LOGIN Response FAIL
*Mar 1 00:47:20.559: Se0/0 CHAP: O FAILURE id 170 len 25 msg is "Authentication failed"

R2#show int s0/0
Serial0/0 is up, line protocol is down
Hardware is GT96K Serial
Internet address is 192.168.1.2/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP REQsent, loopback not set

- Cấu hình thay đổi lại thông tin xác thực như ban đầu:

Code: 
R2(config)#username cisco password 123456a@
- Kiểm tra trạng thái của cổng s0/0

Code: 
R2#show int s0/0
Serial0/0 is up, line protocol is up
Hardware is GT96K Serial
Internet address is 192.168.1.2/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: CDPCP, IPCP, loopback not set
- Kiểm tra ping giữa hai Router R1 và R2
Code: 
R2#ping 192.168.1.1Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/30/68 ms
R2#


 

Post a Comment

Mới hơn Cũ hơn