PAP單向認證配置實例:
驗證方:
router-server(config)# username Client password 12345 <--驗證方建立數據庫--> router-server(config)# interface serial 0 router-server(config-if)# encapsulation ppp router-server(config-if)# ppp authentication pap <--選擇使用PAP實現PPP認證--> router-server(config-if)# ^z |
被驗證方:
router-client(config-if)# encapsulation ppp router-client(config-if)# ppp pap sent-username Client password 12345 <--發送驗證信息--> router-client(config-if)# ^z |
PAP雙向認證配置實例:
路由器 A:
routerA(config)# username B password 12345 routerA(config)# interface serial 0 routerA(config-if)# encapsulation ppp routerA(config-if)# ppp authentication pap routerA(config-if)# ppp pap sent-username A password 54321 routerA(config-if)# ^z |
路由器 B:
routerB(config)# username A password 54321 routerB(config)# interface serial 1 routerB(config-if)# encapsulation ppp routerB(config-if)# ppp authentication pap routerB(config-if)# ppp pap sent-username B password 12345 routerB(config-if)# ^z |
CHAP單向認證配置實例:
驗證方:
router-server(config)# username router-client password 12345 router-server(config)# interface serial 0 router-server(config-if)# encapsulation ppp router-server(config-if)# ppp authentication chap router-server(config-if)# ^z |
被驗證方:
router-client(config-if)# encapsulation ppp router-client(config-if)# ppp authentication chap router-client(config-if)# ppp chap hostname router-client router-client(config-if)# ppp chap password 12345 router-client(config-if)# ^z |
路由器 A:
routerA(config)# username routerB password 12345 routerA(config)# interface serial 0 routerA(config-if)# encapsulation ppp routerA(config-if)# ppp authentication chap routerA(config-if)# ppp chap hostname routerA routerA(config-if)# ppp chap password 54321 routerA(config-if)# ^z |
路由器 B:
routerB(config)# username routerA password 54321 routerB(config)# interface serial 1 routerB(config-if)# encapsulation ppp routerB(config-if)# ppp authentication chap routerB(config-if)# ppp chap hostname routerB routerB(config-if)# ppp chap password 12345 routerB(config-if)# ^z |
Telnet使用:
routerA# terminal monitor <--可以傳回在遠端主機執行Debug命令的結果--> routerA# telnet IP-Address [ Router-Name ] <--Telnet到指定的地址或名字的主機--> routerB# [ exit | logout ] <--退出Telnet--> routerB# ++<6>再按 <--掛起Telnet--> routerA# show sessions <--顯示當前所有Telnet的信息,包括Connect-Number --> routerA# Connect-Number <--返回指定的Telnet連接--> routerA# disconnect IP-Address [ Router-Name ] <--斷開指定地址或名字的主機的連接--> routerA# show user <--顯示Telnet到本機的連接信息--> routerA# clear line [ 0 | 1 | 2 | 3 | 4 ] <--斷開指定Telnet到本機的連接--> |
禁止任何Telnet到本機:
router(config)# line vty 0 4 router(config-line)# access-class ACL-Number router(config)# ^z |
設置主機名:
router(config)# hostname Set-Hostname router(config)# ^z router(config)# ^z |
設置用戶模式密碼:
router(config)# line console 0 router(config-line)# login router(config-line)# password Set-Password router(config-line)# ^z |