配置PPP CHAP 認證

2.1 問題

  1. 如圖配置IP地址
  2. 啓用 CHAP 認證,用戶名/密碼爲:HuaWei/CCIE
  3. 確保R1和R2之間可以互通

2.2 方案

使用eNSP搭建實驗環境,如圖-2所示。

圖-2

2.3 步驟

實現此案例需要按照如下步驟進行。

1)配置IP地址,確保設備互通

    <Huawei>system-view     
    [Huawei]sysname R1
    [R1]interface Serial 4/0/0
    [R1-Serial4/0/0]ip add 192.168.12.1 24
    [R1-Serial4/0/0]quit
    <Huawei>system-view 
    [Huawei]sysname R2
    [R2]interface Serial 4/0/0
    [R2-Serial4/0/0]ip address  192.168.12.2 24
    [R2-Serial4/0/0]quit

2)配置CHAP 認證

    [R1]aaa
    [R1-aaa]local-user HuaWei password cipher CCIE //創建用戶名和密碼
    [R1-aaa]local-user HuaWei service-type ppp     // 指定用戶的服務類型爲PPP
    [R1-aaa]quit
    [R1]interface Serial 4/0/0
    [R1-Serial4/0/0]ppp authentication-mode chap //開啓CHAP 認證
    [R1-Serial4/0/0]ppp chap user HuaWei          //指定用於CHAP認證的用戶名
    [R1-Serial4/0/0]quit
    [R2]interface Serial 4/0/0
    [R2-Serial4/0/0]ppp chap user HuaWei          //被認證端使用的用戶名
    [R2-Serial4/0/0]ppp chap password cipher CCIE //被認證端使用的密碼
    [R2-Serial4/0/0]quit 
    [R2]interface Serial 4/0/0
    [R2-Serial4/0/0]shutdown                        //關閉接口
    [R2-Serial4/0/0]undo shutdown                  //打開接口

3)測試R1與R2之間的連通性

    [R2]ping 192.168.12.1
      PING 192.168.12.1: 56  data bytes, press CTRL_C to break
        Reply from 192.168.12.1: bytes=56 Sequence=1 ttl=255 time=60 ms
        Reply from 192.168.12.1: bytes=56 Sequence=2 ttl=255 time=10 ms
        Reply from 192.168.12.1: bytes=56 Sequence=3 ttl=255 time=20 ms
        Reply from 192.168.12.1: bytes=56 Sequence=4 ttl=255 time=20 ms
        Reply from 192.168.12.1: bytes=56 Sequence=5 ttl=255 time=20 ms
      --- 192.168.12.1 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 10/26/60 ms

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章