实验大纲
16.查看RA路由信息(共五个子网,两条直连链路和一条默认路由)
17.查看RC路由信息(共五个子网,两条直连链路和一条默认路由)
1.构建网络拓扑结构图
2.给路由器添加接口卡
给RA和RC添加WIC-1T接口卡
给RB添加WIC-2T接口卡
3.连线
4.配置步骤
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RA
RA(config)#no ip domain-lookup
RA(config)#enable secret cisco
RA(config)#service password-encryption
RA(config)#line con 0
RA(config-line)#password cisco
RA(config-line)#login
RA(config-line)#logg synchronous
RA(config-line)#exec-timeout 0 0
RA(config-line)#exit
RA(config)#
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RB
RB(config)#no ip domain-lookup
RB(config)#enable secret cisco
RB(config)#service password-encryption
RB(config)#line con 0
RB(config-line)#password cisco
RB(config-line)#login
RB(config-line)#logg synchronous
RB(config-line)#exec-timeout 0 0
RB(config-line)#exit
RB(config)#
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname RC
RC(config)#no ip domain-lookup
RC(config)#enable secret cisco
RC(config)#service password-encryption
RC(config)#line con 0
RC(config-line)#password cisco
RC(config-line)#login
RC(config-line)#logg synchronous
RC(config-line)#exec-timeout 0 0
RC(config-line)#exit
RC(config)#
5.路由器接口配置
配置和启动路由器的每个接口:
以太网接口配置IP地址和子网掩码;
串行接口配置IP地址和子网掩码,并在DCE端配置时钟频率。
RA(config)#interface f0/0
RA(config-if)#desc LAN link to SWA in buliding A
RA(config-if)#ip add 192.168.199.1 255.255.255.128
RA(config-if)#no shutdown
RA(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
RA(config-if)#exit
RA(config)#int serial 0/0
RA(config-if)#desc WAN link to RB in buliding B
RA(config-if)#ip add 192.168.199.225 255.255.255.252
RA(config-if)#clock rate 500000
RA(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
RA(config-if)#
RC(config)#int f0/0
RC(config-if)#desc LAN link to SWC in building C
RC(config-if)#ip add 192.168.199.129 255.255.255.192
RC(config-if)#no shutdown
RC(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
RC(config-if)#int se0/0
RC(config-if)#desc WAN link to SWB in building B
RC(config-if)#ip add 192.168.199.230 255.255.255.252
RC(config-if)#clock rate 500000
This command applies only to DCE interfaces
RC(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
RC(config-if)#
RB(config)#int f0/0
RB(config-if)#desc LAN link to SWB in building B
RB(config-if)#ip add 192.168.199.193 255.255.255.224
RB(config-if)#no shutdown
RB(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
RB(config-if)#int se0/0
RB(config-if)#desc WAN link to RA in building A
RB(config-if)#ip add 192.168.199.226 255.255.255.252
RB(config-if)#no shut
RB(config-if)#
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
RB(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
RB(config-if)#int se0/1
RB(config-if)#desc WAN link to RC in building C
RB(config-if)#ip add 192.168.199.229 255.255.255.252
RB(config-if)#no shut
RB(config-if)#
%LINK-5-CHANGED: Interface Serial0/1, changed state to up
RB(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up
6.PC机的IP配置
7.网络测试
在RA测试,测试与PCA和RB的连通性
RA#ping 192.168.199.126
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.126, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
RA#ping 192.168.199.226
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.226, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/6/10 ms
在RC测试,测试与PCC和RB的连通性
RC#ping 192.168.199.190
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.190, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/1/4 ms
RC#ping 192.168.199.229
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.229, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/7/11 ms
在RB测试,测试与PCB和RA、RC的连通性
RB#ping 192.168.199.222
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.222, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
RB#ping 192.168.199.225
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.225, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 6/22/86 ms
RB#ping 192.168.199.230
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.199.230, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/5/9 ms
8.在PCA上测试到PCB和PCC的连通性
9.保存到配置文件
RA#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RB#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RC#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
10.查看路由信息
查看RA的路由信息
查看RB的路由信息
查看RC的路由信息
11.配置静态路由
在RA上配置静态路由,配置到其他三个子网的静态路由,静态路由的管理距离默认值为1
RA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RA(config)#ip route 192.168.199.192 255.255.255.224 192.168.199.226
RA(config)#ip route 192.168.199.228 255.255.255.252 192.168.199.226
RA(config)#ip route 192.168.199.128 255.255.255.192 192.168.199.226
在RB上配置静态路由,配置到其他两个子网的静态路由,静态路由的管理距离默认值为1
RB#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RB(config)#ip route 192.168.199.0 255.255.255.128 192.168.199.225
RB(config)#ip route 192.168.199.128 255.255.255.192 192.168.199.230
在RC上配置静态路由,配置到其他三个子网的静态路由,静态路由的管理距离默认值为1
RC#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RC(config)#ip route 192.168.199.192 255.255.255.224 192.168.199.229
RC(config)#ip route 192.168.199.224 255.255.255.252 192.168.199.229
RC(config)#ip route 192.168.199.0 255.255.255.128 192.168.199.229
12.检查三个路由器的路由表信息
RA#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 192.168.199.0/24 is variably subnetted, 5 subnets, 4 masks C 192.168.199.0/25 is directly connected, FastEthernet0/0 S 192.168.199.128/26 [1/0] via 192.168.199.226 S 192.168.199.192/27 [1/0] via 192.168.199.226 C 192.168.199.224/30 is directly connected, Serial0/0 S 192.168.199.228/30 [1/0] via 192.168.199.226
RB#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 192.168.199.0/24 is variably subnetted, 5 subnets, 4 masks S 192.168.199.0/25 [1/0] via 192.168.199.225 S 192.168.199.128/26 [1/0] via 192.168.199.230 C 192.168.199.192/27 is directly connected, FastEthernet0/0 C 192.168.199.224/30 is directly connected, Serial0/0 C 192.168.199.228/30 is directly connected, Serial0/1
RC#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 192.168.199.0/24 is variably subnetted, 5 subnets, 4 masks S 192.168.199.0/25 [1/0] via 192.168.199.229 C 192.168.199.128/26 is directly connected, FastEthernet0/0 S 192.168.199.192/27 [1/0] via 192.168.199.229 S 192.168.199.224/30 [1/0] via 192.168.199.229 C 192.168.199.228/30 is directly connected, Serial0/0
13.测试网络B
PCA测试到PCB和PC的连通性
14.保存到配置文件中
RA#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RA#
RB#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RC#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
15.配置默认路由
RA和RC都把目标网络不是其直连网络的的数据包转发给RB,因此,可将具体的静态路由改为默认路由以减少路由表项。
# 取消原先配置的3条静态路由
RA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RA(config)#no ip route 192.168.199.192 255.255.255.224 192.168.199.226
RA(config)#no ip route 192.168.199.228 255.255.255.252 192.168.199.226
RA(config)#no ip route 192.168.199.128 255.255.255.192 192.168.199.226
RA(config)#ip route 0.0.0.0 0.0.0.0 192.168.199.226
RC#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RC(config)#no ip route 192.168.199.192 255.255.255.224 192.168.199.229
RC(config)#no ip route 192.168.199.224 255.255.255.252 192.168.199.229
RC(config)#no ip route 192.168.199.0 255.255.255.128 192.168.199.229
RC(config)#ip route 0.0.0.0 0.0.0.0 192.168.199.229
16.查看RA路由信息(共五个子网,两条直连链路和一条默认路由)
17.查看RC路由信息(共五个子网,两条直连链路和一条默认路由)
路由器RA到达非直连网络的路径只有一条,那就是通过路由器RB,因此只要配置一条默认路由即可;
同样,路由器RC到达非直连网络的路径也只有一条,那就是通过路由器RB,因此也只要配置一条默认路由即可。
通过在RA和RC上配置默认路由,使它们的路由表项各自从5项减到了3项。如果网络的规模增大,则减少的幅度将更大。
18.保存到启动配置文件
RA#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RB#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
RC#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
19.网络测试C
在PCA测试到PCB和PC的连通性
20.增加和配置冗余链路
两个网络之间若只有一条链路,则当它出现故障时两个网络之间的通信就会中断。为了增加可靠性,可 以增加备份链路。在网络中,任何一条串行线故障将造成网络不能全部连通。若想提高网络的可靠性, 可为串行线路各增加一条备份线路,在路由器RA和RC上各增配一块WIC-1T接口卡,在路由器RB增配一 块WIC-2T接口卡后,方可连接备份串行线。
在RA增加一块WIC-1T接口卡
在RB增加一块WIC-2T接口卡
在RC增加一块WIC-1T接口卡
21.再次连线
22.配置路由器接口
RA#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RA(config)#int se0/1
RA(config-if)#desc WAN link to RB for backup
RA(config-if)#ip add 192.168.199.233 255.255.255.252
RA(config-if)#clock rate 500000
RA(config-if)#no shut
RC#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RC(config)#int se0/1
RC(config-if)#desc WAN link to RB for backup
RC(config-if)#ip add 192.168.199.238 255.255.255.252
RC(config-if)#clock rate 500000
This command applies only to DCE interfaces
RC(config-if)#no shut
RB#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RB(config)#int se0/2
RB(config-if)#desc WAN link to RA for backup
RB(config-if)#ip add 192.168.199.234 255.255.255.252
RB(config-if)#no shut
RB(config-if)#int se0/3
RB(config-if)#desc WAN link to RC for backup
RB(config-if)#ip add 192.168.199.237 255.255.255.252
RB(config-if)#no shut