项目名称:OSPF动态路由技术实现园区子网与外网互连项目 项目目标:使用OSPF动态路由技术实现园区子网与外网的互联互通 项目情境:XXX学校的校区由原来的一个校区扩展为两个校区,为了实现
校园整体信息化建设的需要,需要把两个分散的校园网连接为一体,并与外网连接,使用OSPF动态路由技术可以实现子网之间、子网与外网之间的互联互通。
组网设备:PC机5台,网线若干根,RSR20路由器2台,锐捷RG-S3760-24
交换机1台,锐捷RG-S2126S交换机1台
网络拓扑:
RSR20-1 FA0/1 FA0/0 Loopback S3760-24 S2126S S2/0 S2/0 FA0/1 PC5 RSR20-2 A区 PC1 PC2 PC3 Vlan20 PC4 Vlan30 B区 小组成员分工:
张春林、任建强:网线的连接与PC机IP地址设置 阚 青、刘海沧:负责交换机配置 郭 敏、段 炼:负责路由器配置
辛北辰、翟 玮:负责网络连通测试、实验记录及整理
施工过程:
步骤一:安装网络工作环境
按上图中的网络拓扑结构安装和连接设备,注意设备连接的接口标
识,连接完成后检查连接线缆指示灯的工作状态,清除原来的配置信息。
步骤二:IP地址规划与设置 设备名称 PC1 PC2 PC3 PC4 PC5 S3760-24的Fa0/24口 S2126S的Fa0/24口 RSR20-1的S2/0口 RSR20-1的Fa 0/1口 RSR20-1的Fa 0/0.1口 RSR20-1的Fa 0/0.2口 RSR20-2的S2/0口 RSR20-2的Fa 0/1口 IP地址 10.1.4.10 10.1.5.10 10.1.2.10 10.1.3.10 子网掩码 网关 接口 Fa 0/3口 Fa 0/2口 Fa 0/4口 Fa 0/5口 255.255.255.0 10.1.4.1 255.255.255.0 10.1.5.1 255.255.255.0 10.1.2.1 255.255.255.0 10.1.3.1 202.10.8.10 255.255.255.0 202.10.8.1 Fa 0/1口 10.1.1.2 255.255.255.0 Fa0/1口 Fa0/0口 172.16.1.2 255.255.255.0 10.1.1.1 10.1.2.1 10.1.3.1 255.255.255.0 255.255.255.0 255.255.255.0 172.16.1.1 255.255.255.0 202.10.8.1 255.255.255.0 RSR20-2的Loopback口 200.18.8.1 255.255.255.0 步骤三:配置交换机
S3760-24>en 14 Password:
S3760-24#config
S3760-24(config)#no log con S3760-24(config)#int fa0/2
S3760-24(config-if-FastEthernet 0/2)#no swit
S3760-24(config-if-FastEthernet 0/2)#ip add 10.1.5.1 255.255.255.0 S3760-24(config-if-FastEthernet 0/2)#int fa0/3 S3760-24(config-if-FastEthernet 0/3)#no swit
S3760-24(config-if-FastEthernet 0/3)#ip add 10.1.4.1 255.255.255.0 S3760-24(config-if-FastEthernet 0/3)#no shut S3760-24(config-if-FastEthernet 0/3)#int fa 0/24
S3760-24(config-if-FastEthernet 0/24)#no swi
S3760-24(config-if-FastEthernet 0/24)#ip add 10.1.1.2 255.255.255.0 S3760-24(config-if-FastEthernet 0/24)#rout ospf
S3760-24(config-router)#network 10.1.5.0 0.0.0.255 are 0 S3760-24(config-router)#network 10.1.4.0 0.0.0.255 are 0 S3760-24(config-router)#network 10.1.1.0 0.0.0.255 are 0 S3760-24(config-router)#exit
S3760-24(config)#show ip rout
Codes: C - connected, S - static, R - RIP, B - BGP 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is no set
C 10.1.1.0/24 is directly connected, FastEthernet 0/24 C 10.1.1.2/32 is local host.
C 10.1.4.0/24 is directly connected, FastEthernet 0/3 C 10.1.4.1/32 is local host.
C 10.1.5.0/24 is directly connected, FastEthernet 0/2 C 10.1.5.1/32 is local host.
S2126s#show vlan
VLAN Name Status Ports ---- -------------------------------- --------- -------------------------------
1 default active Fa0/1 ,Fa0/2 ,Fa0/3 Fa0/4 ,Fa0/5 ,Fa0/6
Fa0/7 ,Fa0/8 ,Fa0/9 Fa0/10,Fa0/11,Fa0/12 Fa0/13,Fa0/14,Fa0/15 Fa0/16,Fa0/17,Fa0/18
Fa0/19,Fa0/20,Fa0/21
Fa0/22,Fa0/23,Fa0/24 20 VLAN0020 active 30 VLAN0030 active S2126s#confi
S2126s(config)#int fa0/4
S2126s(config-if)#switch access vlan 20 S2126s(config-if)#int fa0/5
S2126s(config-if)#switch access vlan 30 S2126s(config-if)#exit S2126s(config)#exit
S2126s#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1 ,Fa0/2 ,Fa0/3
Fa0/6 ,Fa0/7 ,Fa0/8 Fa0/9 ,Fa0/10,Fa0/11 Fa0/12,Fa0/13,Fa0/14 Fa0/15,Fa0/16,Fa0/17
Fa0/18,Fa0/19,Fa0/20 Fa0/21,Fa0/22,Fa0/23 Fa0/24 20 VLAN0020 active Fa0/4 30 VLAN0030 active Fa0/5 S2126s#config
S2126s(config)#int fa 0/24
S2126s(config-if)#switch mode trunk S2126s(config-if)#exit S2126s(config)#exit
S2126s#show vlan
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Fa0/1 ,Fa0/2 ,Fa0/3 Fa0/6 ,Fa0/7 ,Fa0/8 Fa0/9 ,Fa0/10,Fa0/11 Fa0/12,Fa0/13,Fa0/14 Fa0/15,Fa0/16,Fa0/17 Fa0/18,Fa0/19,Fa0/20 Fa0/21,Fa0/22,Fa0/23 Fa0/24 20 VLAN0020 active Fa0/4 ,Fa0/24 30 VLAN0030 active Fa0/5 ,Fa0/24
步骤四:配置路由器
RSR20-1>en 14
Password:
RSR20-1#config
RSR20-1(config)#int fa0/1
RSR20-1(config-if)#ip address 10.1.1.1 255.255.255.0 RSR20-1(config-if)#no shut
RSR20-1(config-if)#int s2/0
RSR20-1(config-if)#ip address 172.16.1.2 255.255.255.0 RSR20-1(config-if)#no shut RSR20-1(config-subif)#int fa0/0.1
RSR20-1(config-subif)#encapsulation dot1q 20 RSR20-1(config-subif)#no shut RSR20-1(config-subif)#int fa0/0.2
RSR20-1(config-subif)#encapsulation dot1q 30 RSR20-1(config-subif)#no shut
RSR20-1(config-subif)#exit RSR20-1(config)#exit RSR20-1#config
Enter configuration commands, one per line. End with CNTL/Z. RSR20-1(config)#int fa0/0.1
RSR20-1(config-subif)#ip address 10.1.2.1 255.255.255.0 RSR20-1(config-subif)#no shut RSR20-1(config-subif)#end RSR20-1#config
RSR20-1(config)#show int fa0/0.1 ifindex(dec):5 (hex):5
FastEthernet 0/0.1 is UP , line protocol is UP
Hardware is MPC8248 FCC FAST ETHERNET CONTROLLER FastEthernet, address is 001a.a 941.faab (bia 001a.a941.faab)
Interface address is: 10.1.2.1/24
ARP type: ARPA,ARP Timeout: 3600 seconds
MTU 1500 bytes, BW 100000 Kbit
Encapsulation protocol is 802.1Q Virtual LAN,Vlan ID 20 RSR20-1(config)#int fa0/0.2
RSR20-1(config-subif)#ip address 10.1.3.1 255.255.255.0 RSR20-1(config-subif)#no shut RSR20-1(config-subif)#exit
RSR20-1(config)#show int fa0/0.2
ifindex(dec):6 (hex):6
FastEthernet 0/0.2 is UP , line protocol is UP
Hardware is MPC8248 FCC FAST ETHERNET CONTROLLER FastEthernet, address is 001a.a 941.faab (bia 001a.a941.faab) Interface address is: 10.1.3.1/24
ARP type: ARPA,ARP Timeout: 3600 seconds MTU 1500 bytes, BW 100000 Kbit
Encapsulation protocol is 802.1Q Virtual LAN,Vlan ID 30 RSR20-1(config)#route ospf
RSR20-1(config-router)#network 10.1.1.0 0.0.0.255 area 0 RSR20-1(config-router)#network 10.1.2.0 0.0.0.255 area 0 RSR20-1(config-router)#network 10.1.3.0 0.0.0.255 area 0 RSR20-1(config-router)#network 172.16.1.0 0.0.0.255 area 0 RSR20-1(config-router)#exit RSR20-1(config)#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is no set
C 10.1.1.0/24 is directly connected, FastEthernet 0/1 C 10.1.1.1/32 is local host.
C 10.1.2.0/24 is directly connected, FastEthernet 0/0.1 C 10.1.2.1/32 is local host.
C 10.1.3.0/24 is directly connected, FastEthernet 0/0.2 C 10.1.3.1/32 is local host.
O 10.1.4.0/24 [110/2] via 10.1.1.2, 00:12:01, FastEthernet 0/1 O 10.1.5.0/24 [110/2] via 10.1.1.2, 00:12:01, FastEthernet 0/1 C 172.16.1.0/24 is directly connected, Serial 2/0 C 172.16.1.2/32 is local host.
RSR20_2>en 14 Password:
RSR20_2#config
Enter configuration commands, one per line. End with CNTL/Z. RSR20_2(config)#int fa0/1
RSR20_2(config-if)#ip address 202.10.8.1 255.255.255.0 RSR20_2(config-if)#int s2/0
RSR20_2(config-if)#ip address 172.16.1.1 255.255.255.0 RSR20_2(config)#route ospf
RSR20_2(config-router)#network 202.10.8.0 0.0.0.255 area 0 RSR20_2(config-router)#network 172.16.1.0 0.0.0.255 area 0 RSR20_2(config-router)#network 172.16.1.0 0.0.0.255 area 0 RSR20_2(config-router)#exit
RSR20_2(config)#int loopback0
RSR20_2(config-if)#ip address 200.18.8.1 255.255.255.0 RSR20_2(config-if)#no shut RSR20_2(config-if)#exit RSR20_2(config)#router ospf
RSR20_2(config-router)#network 200.18.8.0 0.0.0.255 area 0 RSR20_2(config-router)#exit RSR20_2(config)#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP 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
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default Gateway of last resort is no set
O 10.1.1.0/24 [110/51] via 172.16.1.2, 00:01:43, Serial 2/0 O 10.1.2.0/24 [110/51] via 172.16.1.2, 00:01:43, Serial 2/0 O 10.1.3.0/24 [110/51] via 172.16.1.2, 00:01:43, Serial 2/0 O 10.1.4.0/24 [110/52] via 172.16.1.2, 00:01:43, Serial 2/0 O 10.1.5.0/24 [110/52] via 172.16.1.2, 00:01:43, Serial 2/0 C 172.16.1.0/24 is directly connected, Serial 2/0 C 172.16.1.1/32 is local host.
C 200.18.8.0/24 is directly connected, Loopback 0 C 200.18.8.1/32 is local host.
C 202.10.8.0/24 is directly connected, FastEthernet 0/1 C 202.10.8.1/32 is local host. RSR20_2(config)#
步骤五:测试网络连通
用ping命令测试网络中的任意位置,网络实现互联互通。
故障的检查与排除:
在配置与测试过程中,出现多次故障,检查原因有如下几点: 1、PC机IP地址设置错误;
2、S3760-24交换机和路由器在配置时,没有按先封装802.1q协议,再配置IP地址这样的顺序来操作;
3、为路由器配置OSPF单区域操作时,发布网段信息和分配区域号的操作不完全。
在检查出原因后,重新修改配置,再用ping命令测试网络的连通性,网络实现了互连。
因篇幅问题不能全部显示,请点此查看更多更全内容