实训二十四 三层交换机OSPF动态路由.docx
- 文档编号:23838432
- 上传时间:2023-05-21
- 格式:DOCX
- 页数:20
- 大小:159.28KB
实训二十四 三层交换机OSPF动态路由.docx
《实训二十四 三层交换机OSPF动态路由.docx》由会员分享,可在线阅读,更多相关《实训二十四 三层交换机OSPF动态路由.docx(20页珍藏版)》请在冰豆网上搜索。
实训二十四三层交换机OSPF动态路由
实训二十四三层交换机OSPF动态路由
一、实训目的
1、掌握三层交换机之间通过OSPF协议实现网段互通的配置方法。
2、理解RIP协议和OSPF协议内部实现的不同点
二、应用环境
当两台三层交换机级联时,为了保证每台交换机上所连接的网段可以和另一台交换机上连接的网段互相通信,使用OSPF协议可以动态学习路由。
三、实训设备
1.DCRS-5650-52CT交换机2台
2.PC机2-4台
3.Console线1-2根
4.直通网线2-4根
四、实训拓扑
五、实训要求
1、在交换机A和交换机B上分别划分基于端口的VLAN:
交换机
VLAN
端口成员
交换机A
10
1~8
20
9~16
100
24
交换机B
30
1~8
40
9~16
101
24
2、交换机A和B通过的24口级联。
3、配置交换机A和B各VLAN虚拟接口的IP地址分别如下表所示:
VLAN10
VLAN20
VLAN30
VLAN40
VLAN100
VLAN101
4、的网络设置为:
设备
IP地址
gateway
Mask
PC1
PC2
PC3
PC4
5、验证:
没有OSPF路由协议之前:
PC1与PC2,PC3与PC4可以互通。
PC1、PC2与PC3、PC4不通。
配置OSPF路由协议之后:
四台PC之间都可以互通。
若实训结果和理论相符,则本实训完成。
六、实训步骤
第一步:
交换机全部恢复出厂设置,配置交换机的VLAN信息
交换机A:
DCRS-5650-52CT-A#conf
DCRS-5650-52CT-A(Config)#vlan10
DCRS-5650-52CT-A(Config-Vlan10)#switchportinterfaceethernet0/0/1-8
SettheportEthernet0/0/1accessvlan10successfully
SettheportEthernet0/0/2accessvlan10successfully
SettheportEthernet0/0/3accessvlan10successfully
SettheportEthernet0/0/4accessvlan10successfully
SettheportEthernet0/0/5accessvlan10successfully
SettheportEthernet0/0/6accessvlan10successfully
SettheportEthernet0/0/7accessvlan10successfully
SettheportEthernet0/0/8accessvlan10successfully
DCRS-5650-52CT-A(Config-Vlan10)#exit
DCRS-5650-52CT-A(Config)#vlan20
DCRS-5650-52CT-A(Config-Vlan20)#switchportinterfaceethernet0/0/9-16
SettheportEthernet0/0/9accessvlan20successfully
SettheportEthernet0/0/10accessvlan20successfully
SettheportEthernet0/0/11accessvlan20successfully
SettheportEthernet0/0/12accessvlan20successfully
SettheportEthernet0/0/13accessvlan20successfully
SettheportEthernet0/0/14accessvlan20successfully
SettheportEthernet0/0/15accessvlan20successfully
SettheportEthernet0/0/16accessvlan20successfully
DCRS-5650-52CT-A(Config-Vlan20)#exit
DCRS-5650-52CT-A(Config)#vlan100
DCRS-5650-52CT-A(Config-Vlan100)#switchportinterfaceethernet0/0/24
SettheportEthernet0/0/24accessvlan100successfully
DCRS-5650-52CT-A(Config-Vlan100)#exit
DCRS-5650-52CT-A(Config)#
验证配置:
DCRS-5650-52CT-A#showvlan
VLANNameTypeMediaPorts
---------------------------------------------------------------------------
1defaultStaticENETEthernet0/0/17Ethernet0/0/18
Ethernet0/0/19Ethernet0/0/20
Ethernet0/0/21Ethernet0/0/22
Ethernet0/0/23Ethernet0/0/25
Ethernet0/0/26Ethernet0/0/27
Ethernet0/0/28
10VLAN0010StaticENETEthernet0/0/1Ethernet0/0/2
Ethernet0/0/3Ethernet0/0/4
Ethernet0/0/5Ethernet0/0/6
Ethernet0/0/7Ethernet0/0/8
20VLAN0020StaticENETEthernet0/0/9Ethernet0/0/10
Ethernet0/0/11Ethernet0/0/12
Ethernet0/0/13Ethernet0/0/14
Ethernet0/0/15Ethernet0/0/16
100VLAN0100StaticENETEthernet0/0/24
DCRS-5650-52CT-A#
交换机B:
DCRS-5650-52CT-B(Config)#vlan30
DCRS-5650-52CT-B(Config-Vlan30)#switchportinterfaceethernet0/0/1-8
SettheportEthernet0/0/1accessvlan30successfully
SettheportEthernet0/0/2accessvlan30successfully
SettheportEthernet0/0/3accessvlan30successfully
SettheportEthernet0/0/4accessvlan30successfully
SettheportEthernet0/0/5accessvlan30successfully
SettheportEthernet0/0/6accessvlan30successfully
SettheportEthernet0/0/7accessvlan30successfully
SettheportEthernet0/0/8accessvlan30successfully
DCRS-5650-52CT-B(Config-Vlan30)#exit
DCRS-5650-52CT-B(Config)#vlan40
DCRS-5650-52CT-B(Config-Vlan40)#switchportinterfaceethernet0/0/9-16
SettheportEthernet0/0/9accessvlan40successfully
SettheportEthernet0/0/10accessvlan40successfully
SettheportEthernet0/0/11accessvlan40successfully
SettheportEthernet0/0/12accessvlan40successfully
SettheportEthernet0/0/13accessvlan40successfully
SettheportEthernet0/0/14accessvlan40successfully
SettheportEthernet0/0/15accessvlan40successfully
SettheportEthernet0/0/16accessvlan40successfully
DCRS-5650-52CT-B(Config-Vlan40)#exit
DCRS-5650-52CT-B(Config)#vlan101
DCRS-5650-52CT-B(Config-Vlan101)#switchportinterfaceethernet0/0/24
SettheportEthernet0/0/24accessvlan101successfully
DCRS-5650-52CT-B(Config-Vlan101)#exit
DCRS-5650-52CT-B(Config)#
验证配置:
DCRS-5650-52CT-B#showvlan
VLANNameTypeMediaPorts
---------------------------------------------------------------------------
1defaultStaticENETEthernet0/0/17Ethernet0/0/18
Ethernet0/0/19Ethernet0/0/20
Ethernet0/0/21Ethernet0/0/22
Ethernet0/0/23Ethernet0/0/25
Ethernet0/0/26Ethernet0/0/27
Ethernet0/0/28
10VLAN0010StaticENETEthernet0/0/1Ethernet0/0/2
Ethernet0/0/3Ethernet0/0/4
Ethernet0/0/5Ethernet0/0/6
Ethernet0/0/7Ethernet0/0/8
20VLAN0020StaticENETEthernet0/0/9Ethernet0/0/10
Ethernet0/0/11Ethernet0/0/12
Ethernet0/0/13Ethernet0/0/14
Ethernet0/0/15Ethernet0/0/16
100VLAN0100StaticENETEthernet0/0/24
DCRS-5650-52CT-B#
第二步:
配置交换机各vlan虚接口的IP地址
交换机A:
DCRS-5650-52CT-A(Config)#intvlan10
DCRS-5650-52CT-A(Config-If-Vlan10)#ipaddress-A(Config-If-Vlan10)#noshut
DCRS-5650-52CT-A(Config-If-Vlan10)#exit
DCRS-5650-52CT-A(Config)#intvlan20
DCRS-5650-52CT-A(Config-If-Vlan20)#ipaddress-A(Config-If-Vlan20)#noshut
DCRS-5650-52CT-A(Config-If-Vlan20)#exit
DCRS-5650-52CT-A(Config)#intvlan100
DCRS-5650-52CT-A(Config-If-Vlan100)#ipaddress-A(Config-If-Vlan100)#noshut
DCRS-5650-52CT-A(Config-If-Vlan100)#
DCRS-5650-52CT-A(Config-If-Vlan100)#exit
DCRS-5650-52CT-A(Config)#
交换机B:
DCRS-5650-52CT-B(Config)#intvlan30
DCRS-5650-52CT-B(Config-If-Vlan30)#ipaddress-B(Config-If-Vlan30)#noshut
DCRS-5650-52CT-B(Config-If-Vlan30)#exit
DCRS-5650-52CT-B(Config)#interfacevlan40
DCRS-5650-52CT-B(Config-If-Vlan40)#ipaddress-B(Config-If-Vlan40)#exit
DCRS-5650-52CT-B(Config)#intvlan101
DCRS-5650-52CT-B(Config-If-Vlan101)#ipaddress-B(Config-If-Vlan101)#exit
DCRS-5650-52CT-B(Config)#
第三步:
配置各PC的IP地址,注意配置网关
设备
IP地址
gateway
Mask
PC1
PC2
PC3
PC4
第四步:
验证PC之间是否连通
PC
端口
PC
端口
结果
原因
PC1
A:
0/0/1
PC2
A:
0/0/9
通
PC1
A:
0/0/1
Vlan100
A:
0/0/24
通
PC1
A:
0/0/1
Vlan101
B:
0/0/24
不通
PC1
A:
0/0/1
PC3
B:
0/0/1
不通
查看路由表,进一步分析上一步的现象原因。
交换机A:
DCRS-5650-52CT-A#showiproute
Codes:
K-kernel,C-connected,S-static,R-RIP,B-BGP
O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1,E2-OSPFexternaltype2
i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea
*-candidatedefault
Cisdirectlyconnected,Loopback
Cisdirectlyconnected,Vlan10
Cisdirectlyconnected,Vlan20
Cisdirectlyconnected,Vlan100
交换机B:
DCRS-5650-52CT-B#showiproute
Codes:
K-kernel,C-connected,S-static,R-RIP,B-BGP
O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1,E2-OSPFexternaltype2
i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea
*-candidatedefault
Cisdirectlyconnected,Loopback
Cisdirectlyconnected,Vlan30
Cisdirectlyconnected,Vlan40
Cisdirectlyconnected,Vlan101
第五步:
启动OSPF协议,并将对应的直连网段配置到OSPF进程中
交换机A:
DCRS-5650-52CT-A(config)#routerospf
DCRS-5650-52CT-A(config-router)#networkarea0
DCRS-5650-52CT-A(config-router)#networkarea0
DCRS-5650-52CT-A(config-router)#networkarea0
DCRS-5650-52CT-A(config-router)#exit
交换机B:
DCRS-5650-52CT-B(config)#routerospf
DCRS-5650-52CT-B(config-router)#networkarea0
DCRS-5650-52CT-B(config-router)#networkarea0
DCRS-5650-52CT-B(config-router)#networkarea0
DCRS-5650-52CT-B(config-router)#exit
验证配置:
交换机A:
DCRS-5650-52CT-A#showiproute
Codes:
K-kernel,C-connected,S-static,R-RIP,B-BGP
O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1,E2-OSPFexternaltype2
i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea
*-candidatedefault
Cisdirectlyconnected,Loopback
Cisdirectlyconnected,Vlan10
Cisdirectlyconnected,Vlan20
O[110/20]viaVlan100,00:
00:
23
O[110/20]viaVlan100,00:
00:
23
Cisdirectlyconnected,Vlan100
(O代表ospf学习到的路由网段)
交换机B:
DCRS-5650-52CT-B#showiproute
Codes:
K-kernel,C-connected,S-static,R-RIP,B-BGP
O-OSPF,IA-OSPFinterarea
N1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2
E1-OSPFexternaltype1,E2-OSPFexternaltype2
i-IS-IS,L1-IS-ISlevel-1,L2-IS-ISlevel-2,ia-IS-ISinterarea
*-candidatedefault
Cisdirectlyconnected,Loopback
O[110/20]viaVlan101,00:
00:
23
O[110/20]viaVlan101,00:
00:
23
Cisdirectlyconnected,Vlan30
Cisdirectlyconnected,Vlan40
Cisdirectlyconnected,Vlan101
(O代表ospf学习到的路由网段)
第六步:
验证PC之间是否连通
PC
端口
PC
端口
结果
原因
PC1
A:
0/0/1
PC2
A:
0/0/9
通
PC1
A:
0/0/1
Vlan100
A:
0/0/24
通
PC1
A:
0/0/1
Vlan101
B:
0/0/24
通
PC1
A:
0/0/1
PC3
B:
0/0/1
通
七、注意事项和排错
在配置、使用OSPF协议时,可能会由于物理连接、配置错误等原因导致OSPF协议未能正常运行。
因此,用户应注意一下要点:
首先应该保证物理连接的正确无误;
其次,保证接口和链路协议是UP(使用showinterface命令);
然后在各接口上配置不同网段的IP地址;
然后,先启动OSPF协议(使用routerospf命令)再在相应接口配置所属OSPF域;
接着,注意OSPF协议的自身特点——OSPF骨干域(0域)必须保证是连续的,如果不连续使用虚连接(virtuallink)接来保证,所有非0域只能通过0域与其他非0域相连,不允许非0域直接相连;边界三层交换机是指该三层交换机的一部分接口属于0域,而另外一部分接口属于非0域;对于广播网等多路访问网,需要选举指定三层交换机DR。
八、配置序列
交换机A:
DCRS-5650-52CT-A#showrun
!
noservicepassword-encryption
!
hostnameDCRS-5650-52CT-A
!
InterfaceEthernet0
!
vlan1
!
vlan10
!
vlan20
!
vlan100
!
InterfaceEthernet0/0/1
switchportaccessvlan10
!
InterfaceEthernet0/0/2
switchportaccessvlan10
!
……
InterfaceEthernet0/0/23
!
InterfaceEth
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实训二十四 三层交换机OSPF动态路由 实训二 十四 三层 交换机 OSPF 动态 路由
![提示](https://static.bdocx.com/images/bang_tan.gif)