ネットワーク構成
設定条件
- R1でPPP CHAP認証を有効にします。認証のためにAAA認証メソッドリスト「PPP」 を作成します。
- 認証はRADIUSサーバを最初に参照します。RADIUSサーバを利用できなければ、ローカルユーザデータベースによる認証を行います。
- RADIUSサーバとして、192.168.1.100 キー「cisco」を設定します。
初期設定
- R1
ホスト名
PPPカプセル化
IPアドレス - R2
ホスト名
PPPカプセル化/CHAP認証
IPアドレス
R1
-------------------------------------------------- hostname R1 ! interface Serial0/0 ip address 192.168.12.1 255.255.255.0 encapsulation ppp --------------------------------------------------
R2
-------------------------------------------------- hostname R2 ! username R1 password 0 cisco ! interface Serial0/0 ip address 192.168.12.2 255.255.255.252 encapsulation ppp ppp authentication chap --------------------------------------------------
※GNS3プロジェクトダウンロード(ppp_aaa_authentication_init.zip)
設定と確認
【Step1:AAAの有効化】
AAA認証を行うには、まず、aaa new-modelコマンドでAAAを有効化します。
R1
-------------------------------------------------- aaa new-model --------------------------------------------------
【Step2:認証メソッドリストの設定】
PPPの認証に利用する認証メソッドリストを設定します。リストの名前は「PPP」とします。また、認証メソッドは、RADIUSサーバとローカルの順番で設定します。
R1
-------------------------------------------------- aaa authentication ppp PPP group radius local --------------------------------------------------
【Step3:認証メソッドリストの適用】
Step2で作成した認証メソッドリストをPPP認証時に利用するように適用します。そのために、以下のようにppp authentication chapコマンドのあとに認証メソッドリスト名を指定します。
R1
-------------------------------------------------- interface Serial0/0 ppp authentication chap PPP --------------------------------------------------
【Step4:RADIUSサーバの設定】
RADIUSサーバのIPアドレスとキーを設定します。
R1
-------------------------------------------------- radius-server host 192.168.1.100 key cisco --------------------------------------------------
【Step5:ローカルユーザデータベースの設定】
RADIUSサーバが利用できない場合に利用するユーザ名/パスワードをローカルに設定します。
R1
-------------------------------------------------- username R2 password cisco --------------------------------------------------
【Step5:認証の確認】
debug aaa authenticationおよびdebug ppp authenticationでデバッグを有効にしながら、Se0/0をshutdown → no shutdown します。
R1
-------------------------------------------------- R1#debug aaa authentication AAA Authentication debugging is on R1#debug ppp authentication PPP authentication debugging is on R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int se 0/0 R1(config-if)#shutdown *Mar 1 00:20:33.691: %LINK-5-CHANGED: Interface Serial0/0, changed state to administratively down *Mar 1 00:20:34.691: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1(config-if)#no shutdown R1(config-if)# *Mar 1 00:20:38.935: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up *Mar 1 00:20:38.943: AAA/BIND(0000010B): Bind i/f Serial0/0 *Mar 1 00:20:38.951: Se0/0 PPP: Using default call direction *Mar 1 00:20:38.955: Se0/0 PPP: Treating connection as a dedicated line *Mar 1 00:20:38.955: Se0/0 PPP: Session handle[A8000109] Session id[265] *Mar 1 00:20:38.959: Se0/0 PPP: Authorization NOT required *Mar 1 00:20:38.991: Se0/0 CHAP: O CHALLENGE id 3 len 23 from "R1" *Mar 1 00:20:39.011: Se0/0 CHAP: I CHALLENGE id 9 len 23 from "R2" *Mar 1 00:20:39.015: AAA/AUTHEN/PPP (0000010B): Pick method list 'PPP' *Mar 1 00:20:39.023: Se0/0 CHAP: Using hostname from unknown source *Mar 1 00:20:39.023: Se0/0 CHAP: Using password from AAA R1(config-if)# *Mar 1 00:20:39.023: Se0/0 CHAP: O RESPONSE id 9 len 23 from "R1" *Mar 1 00:20:39.027: Se0/0 CHAP: I RESPONSE id 3 len 23 from "R2" *Mar 1 00:20:39.031: AAA/AUTHEN/PPP (0000010B): Pick method list 'PPP' *Mar 1 00:20:39.031: Se0/0 PPP: Sent CHAP LOGIN Request *Mar 1 00:20:39.047: Se0/0 CHAP: I SUCCESS id 9 len 4 R1(config-if)# *Mar 1 00:20:48.215: %RADIUS-4-RADIUS_DEAD: RADIUS server 192.168.1.100:1645,1646 is not responding. *Mar 1 00:20:48.223: %RADIUS-4-RADIUS_ALIVE: RADIUS server 192.168.1.100:1645,1646 is being marked alive. R1(config-if)# *Mar 1 00:20:48.991: Se0/0 AUTH: Timeout 1 *Mar 1 00:20:49.011: Se0/0 CHAP: I RESPONSE id 3 len 23 from "R2" *Mar 1 00:20:49.011: Se0/0 CHAP: Ignoring Additional Response R1(config-if)# *Mar 1 00:20:57.635: Se0/0 PPP: Received LOGIN Response PASS *Mar 1 00:20:57.643: Se0/0 CHAP: O SUCCESS id 3 len 4 R1(config-if)# *Mar 1 00:20:58.643: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up --------------------------------------------------
また、show interface serial 0/0をみると、LCP openとなり、認証が成功してup/upとなっていることがわかります。
R1
-------------------------------------------------- R1#show interfaces serial 0/0 Serial0/0 is up, line protocol is up Hardware is M4T Internet address is 192.168.12.1/24 MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation PPP, LCP Open Open: IPCP, CDPCP, crc 16, loopback not set Keepalive set (10 sec) ~省略~ --------------------------------------------------
※GNS3プロジェクトダウンロード(ppp_aaa_authentication_comp.zip)