2024/06/05
学习时长:3小时
代码行数:未统计
博客数量:1篇
今天主要完成了计网实验2的一部分片段:
实验二 路由器动态路由的配置方法
完成了剩余的路由协议rip和ospf的配置
配置RIPv2路由协议
(1)三层交换机配置RIP协议
Switch(config)#ip routing
Switch(config)#router rip
Switch(config-router)#network 172.16.1.0
Switch(config-router)#network 172.16.5.0
Switch(config-router)#version 2
(2)路由器2配置RIPv2协议
Router(config)#router rip
Router(config-router)#network 172.16.1.0
Router(config-router)#network 172.16.2.0
Router(config-router)#version 2
Router(config-router)#no auto-summary
(3)路由器3配置RIPv2协议
Router(config)#router rip
Router(config-router)#network 172.16.2.0
Router(config-router)#network 172.16.3.0
Router(config-router)#version 2
Router(config-router)#no auto-summary
3.验证三台路由设备的路由表,查看是否自动学习了其他网段的路由信息
交换机:
Switch#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
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.1.0 is directly connected, Vlan10
R 172.16.2.0 [120/1] via 172.16.1.1, 00:00:20, Vlan10
R 172.16.3.0 [120/2] via 172.16.1.1, 00:00:20, Vlan10
C 172.16.5.0 is directly connected, Vlan50
路由器2:
Router#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
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
C 172.16.2.0 is directly connected, Serial2/0
R 172.16.3.0 [120/1] via 172.16.2.2, 00:00:02, Serial2/0
R 172.16.5.0 [120/1] via 172.16.1.2, 00:00:01, FastEthernet1/0
路由器3:
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
172.16.0.0/24 is subnetted, 4 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:01, Serial2/0
C 172.16.2.0 is directly connected, Serial2/0
C 172.16.3.0 is directly connected, FastEthernet1/0
R 172.16.5.0 [120/2] via 172.16.2.1, 00:00:01, Serial2/0
4.配置OSPF路由协议
(1)在交换机上配置OSPF路由协议
Switch(config)#route ospf 1
Switch(config-router)#network 172.16.5.0 0.0.0.255 area 0
Switch(config-router)#network 172.16.1.0 0.0.0.255 area 0
Switch(config-router)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#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
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.1.0 is directly connected, Vlan10
R 172.16.2.0 [120/1] via 172.16.1.1, 00:00:23, Vlan10
R 172.16.3.0 [120/2] via 172.16.1.1, 00:00:23, Vlan10
C 172.16.5.0 is directly connected, Vlan50
(2)在路由器2上配置OSPF路由协议
Router(config)#route ospf 1
Router(config-router)#network 172.16.32.0 0.0.0.255 area 0
Router(config-router)#network 172.16.32.0 0.0.0.255 area 0
Router(config-router)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#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
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.1.0 is directly connected, FastEthernet1/0
C 172.16.2.0 is directly connected, Serial2/0
R 172.16.3.0 [120/1] via 172.16.2.2, 00:00:23, Serial2/0
R 172.16.5.0 [120/1] via 172.16.1.2, 00:00:19, FastEthernet1/0
(3)在路由器3上配置OSPF路由协议
Router(config)#route ospf 1
Router(config-router)#network 172.16.2.0 0.0.0.255 area 0
Router(config-router)#network 172.16.3.0 0.0.0.255 area 0
Router(config-router)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#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
172.16.0.0/24 is subnetted, 4 subnets
R 172.16.1.0 [120/1] via 172.16.2.1, 00:00:03, Serial2/0
C 172.16.2.0 is directly connected, Serial2/0
C 172.16.3.0 is directly connected, FastEthernet1/0
R 172.16.5.0 [120/2] via 172.16.2.1, 00:00:03, Serial2/0
5.测试网络的连通性
从PC0 ping PC1