您的位置:首页 > 职场人生

在CISCO路由器上实现CHAP认证

2009-10-11 20:40 477 查看
在配置PPP验证时有PAP和CHAP的选择,其中PAP为明文传送用户名和口令,不安全;而CHAP则采用哈希值进行验证,口令不会在网上传送,所以安全性比较高。
网络拓扑图如下所示:



说明:PC1的以太口(192.168.10.2)与Router1的以太网接口(192.168.10.1)相连;Router1的Serial 0/0(10.10.10.1)与Router2的Serial 0/0(10.10.10.2)相连,Router1为DCE,Router2为DTE;Router2的以太网接口(192.168.20.1)与PC2的以太口(192.168.20.2)相连。路由协议采用静态路由,路由器为模拟的Cisco3640.

一、Router1的配置如下:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router1
Router1(config)#interface ethernet 0/0
Router1(config-if)#ip address 192.168.10.1 255.255.255.0
Router1(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
Router1(config-if)#exit
Router1(config)#interface serial 0/0
Router1(config-if)#ip address 10.10.10.1 255.255.255.0
Router1(config-if)#clock rate 64000
Router1(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0/0, changed state to up
%LINK-3-UPDOWN: Interface Serial0/0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
Router1(config-if)#exit
%LINK-3-UPDOWN: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up

Router1(config)#ip route 192.168.20.0 255.255.255.0 10.10.10.2
Router1(config)#username Router2 password cisco
Router1(config)#interface serial 0/0
Router1(config-if)#encapsulation ppp
%LINK-3-UPDOWN: Interface Serial0/0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
Router1(config-if)#ppp authentication chap
Router1(config-if)#exit

Router1(config)#exit
Router1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]

%LINK-3-UPDOWN: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up


================================================================

二、Router2的配置如下:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Router2
Router2(config)#interface ethernet 0/0
Router2(config-if)#ip address 192.168.20.1 255.255.255.0
Router2(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
Router2(config-if)#exit
Router2(config)#interface serial 0/0
Router2(config-if)#ip address 10.10.10.2 255.255.255.0

Router2(config-if)#no shutdown
%LINK-3-UPDOWN: Interface Serial0/0, changed state to up
Router2(config-if)#exit

Router2(config)#ip route 192.168.10.0 255.255.255.0 10.10.10.1
%LINK-3-UPDOWN: Interface Serial0/0, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
Router2(config)#username Router1 password cisco
Router2(config)#interface serial 0/0
Router2(config-if)#encapsulation ppp
Router2(config-if)#ppp authentication chap
%LINK-3-UPDOWN: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
Router2(config-if)#exit
Router2(config)#exit
Router2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]


==================================================================

三、测试网络的连通性:

PC1和PC2的IP配置
VPCS 1 >ip 192.168.10.2 192.168.10.1
VPCS 2 >ip 192.168.20.2 192.168.20.1

1、在PC1上pingPC2=》C:>ping 192.168.20.2




2、在PC2上pingPC1=》C:>ping 192.168.10.2





====================================================================

四、查看Serial 0/0的相关信息:
1、Router1#show interfaces serial 0/0
Serial0/0 is up, line protocol is up ------接口与协议均已开启
Hardware is HD64570
Internet address is 10.10.10.1/24

MTU 1500 bytes, BW 1544 Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation PPP, loopback not set, keepalive set (10 sec)
LCP Open -----开启
Open: IPCP, CDPCP ------开启
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of show interface counters never
Queueing strategy: fifo

2、Router2#show interfaces serial 0/0
Serial0/0 is up, line protocol is up -----接口与协议均已开启
Hardware is HD64570
Internet address is 10.10.10.2/24

MTU 1500 bytes, BW 1544 Kbit, DLY 1000 usec, rely 255/255, load 1/255
Encapsulation PPP, loopback not set, keepalive set (10 sec)
LCP Open -------开启
Open: IPCP, CDPCP -------开启
Last input 00:00:00, output 00:00:00, output hang never
Last clearing of show interface counters never
Queueing strategy: fifo
09年11月8日修改
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网络 职场 休闲