1、根据图示完成拓扑连接,并完成主机IP地址设置(掩码为255.255.255.0,网关根据图示进行填写)
2、分别登陆交换机,修改交换机的名称,并观察MAC地址表的变化
Switch>en \进入特权模式
Switch#config terminal \进入配置视图
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1 \修改交换机系统名称为S1
回到普通模式
S1>show mac-address-table \查看交换机MAC地址表
S1#write \保存配置
Building configuration…[OK]
同样步骤修改s2交换机名称。
3、配置完成路由器接口地址并启用
**Router>enable ** \进入特权模式
**Router#configureterminal ** \进入配置视图
Router(config)#hostnameR1 \修改路由器名称为R1
R1(config)#
R1(config)#interfaceFastEthernet0/0 \进入F0/0接口视图
R1(config-if)#ip address 192.168.1.254 255.255.255.0 \设置IP地址
R1(config-if)#no shutdown \启动接口
R1(config-if)#exit
**R1(config)#interfaceSerial2/0 ** \进入S2/0接口视图
R1(config-if)#ipaddress 192.168.2.11 255.255.255.0 \设置IP地址
**R1(config-if)#noshutdown ** \启动接口
R1(config-if)#end \ 回到最开始模式
**R1#copyrunning-config startup-config ** \第二种保存配置的方式
Destinationfilename [startup-config]?
Buildingconfiguration…[OK]
注:R2路由器配置同上
完成后使用PING命令分别测试各链路连通性。
4、查看并修改路由器S接口数据链路层协议
(1) 查看R1路由器S2/0接口信息
R1#showinterfaces serial 2/0
encapsulation:链路层协议。MTU:最大传输单元。BW:带宽。
2) 修改R1路由器S2/0接口协议为PPP
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface serial 2/0
R1(config-if)#encapsulation ppp \修改数据链路层协议为PPP
R1(config-if)#
%LINEPROTO-5-UPDOWN:Line protocol on Interface Serial2/0, changed state to down
注意:两端链路层协议不一致,链接中断
(3) 修改R2路由器S2/0接口协议为PPP
R2(config)#interface Serial2/0
R2(config-if)#en
R2(config-if)#encapsulation ppp \修改数据链路层协议为PPP
R2(config-if)#
%LINEPROTO-5-UPDOWN:Line protocol on Interface Serial2/0, changed state to up
注意:两端链路层协议都修改为PPP后,链接恢复
5、R2路由器作为主验证方,进行PAP认证
(1) R2路由器生成用户名密码,并设置S2/0接口认证方式为PAP
R2(config)#usernameR1test password 123 \配置视图下生成用户名和密码
R2(config)#interfaceserial 2/0
R2(config-if)#pppauthentication pap //设置认证方式为PAP
R2(config-if)#
%LINEPROTO-5-UPDOWN:Line protocol on Interface Serial2/0, changed state to down
R2#write
Buildingconfiguration…
[OK]
注意:两端认证方式不一致,链路中断
(2) R1作为被验证方
R1>en
R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface serial 2/0
**R1(config-if)#ppp pap sent-username R1test password 0 123 ** \验证用户名和密码
R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changedstate to up
R1#write
Building configuration…
[OK]
6、CHAP双向验证
(1) R1路由器
R1>en
R1#config t
Enterconfiguration commands, one per line. End with CNTL/Z.
R1(config)#usernameR2 password 123456 \设置用户名和密码
R1(config)#interfaceserial 2/0
R1(config-if)#ppp authentication chap \修改数据链路层协议为chap
R1(config-if)#end
R1#write
Building configuration…
[OK]
(2) R2路由器
R2>en
R2#config t
Enterconfiguration commands, one per line. End with CNTL/Z.
R2(config)#usernameR1 password 123456
R2(config)#interfaceserial 2/0
R2(config-if)#ppp authentication chap
R2(config)#end
R2#write
Building configuration…
[OK]