实验301三层交换机OSPF动态路由.docx

上传人:b****0 文档编号:16880153 上传时间:2023-07-19 格式:DOCX 页数:69 大小:54.91KB
下载 相关 举报
实验301三层交换机OSPF动态路由.docx_第1页
第1页 / 共69页
实验301三层交换机OSPF动态路由.docx_第2页
第2页 / 共69页
实验301三层交换机OSPF动态路由.docx_第3页
第3页 / 共69页
实验301三层交换机OSPF动态路由.docx_第4页
第4页 / 共69页
实验301三层交换机OSPF动态路由.docx_第5页
第5页 / 共69页
实验301三层交换机OSPF动态路由.docx_第6页
第6页 / 共69页
实验301三层交换机OSPF动态路由.docx_第7页
第7页 / 共69页
实验301三层交换机OSPF动态路由.docx_第8页
第8页 / 共69页
实验301三层交换机OSPF动态路由.docx_第9页
第9页 / 共69页
实验301三层交换机OSPF动态路由.docx_第10页
第10页 / 共69页
实验301三层交换机OSPF动态路由.docx_第11页
第11页 / 共69页
实验301三层交换机OSPF动态路由.docx_第12页
第12页 / 共69页
实验301三层交换机OSPF动态路由.docx_第13页
第13页 / 共69页
实验301三层交换机OSPF动态路由.docx_第14页
第14页 / 共69页
实验301三层交换机OSPF动态路由.docx_第15页
第15页 / 共69页
实验301三层交换机OSPF动态路由.docx_第16页
第16页 / 共69页
实验301三层交换机OSPF动态路由.docx_第17页
第17页 / 共69页
实验301三层交换机OSPF动态路由.docx_第18页
第18页 / 共69页
实验301三层交换机OSPF动态路由.docx_第19页
第19页 / 共69页
实验301三层交换机OSPF动态路由.docx_第20页
第20页 / 共69页
亲,该文档总共69页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

实验301三层交换机OSPF动态路由.docx

《实验301三层交换机OSPF动态路由.docx》由会员分享,可在线阅读,更多相关《实验301三层交换机OSPF动态路由.docx(69页珍藏版)》请在冰点文库上搜索。

实验301三层交换机OSPF动态路由.docx

实验301三层交换机OSPF动态路由

 

实验三十

(1)、三层交换机OSPF动态路由

一、实验目的

1、掌握三层交换机之间通过OSPF协议实现网段互通的配置方法。

2、理解RIP协议和OSPF协议内部实现的不同点

二、应用环境

当两台三层交换机级联时,为了保证每台交换机上所连接的网段可以和另一台交换机上

连接的网段互相通信,使用OSPF协议可以动态学习路由。

三、实验设备

1、DCRS-7604(或6804)交换机1台

2、DCRS-5526S交换机1台

3、PC机2-4台

4、Console线1-2根

5、直通网线2-4根

四、实验拓扑

 

五、实验要求

1、在交换机A和交换机B上分别划分基于端口的VLAN:

 

交换机

交换机A

 

交换机B

VLAN

10

20

100

30

40

端口成员

1~8

9~16

24

1~8

9~16

 

101

2、交换机A和B通过的24口级联。

 

24

 

3、配置交换机A和B各VLAN虚拟接口的IP地址分别如下表所示:

VLAN10VLAN20VLAN30VLAN40VLAN100

 

VLAN101

 

192.168.10.1192.168.20.1192.168.30.1192.168.40.1192.168.100.1192.168.100.2

4、PC1-PC4的网络设置为:

 

设备

IP地址

gateway

Mask

PC1192.168.10.101

PC2192.168.20.101

192.168.10.1

192.168.20.1

255.255.255.0

255.255.255.0

PC3

192.168.30.101

192.168.30.1

255.255.255.0

PC4192.168.40.101192.168.40.1

5、验证:

没有OSPF路由协议之前:

PC1与PC2,PC3与PC4可以互通。

PC1、PC2与PC3、PC4不通。

配置OSPF路由协议之后:

四台PC之间都可以互通。

若实验结果和理论相符,则本实验完成。

六、实验步骤

255.255.255.0

 

第一步:

交换机全部恢复出厂设置,配置交换机的VLAN信息(同实验27)

交换机A:

DCRS-7604#conf

DCRS-7604(Config)#vlan10

DCRS-7604(Config-Vlan10)#switchportinterfaceethernet1/1-8

SettheportEthernet1/1accessvlan10successfully

SettheportEthernet1/2accessvlan10successfully

SettheportEthernet1/3accessvlan10successfully

SettheportEthernet1/4accessvlan10successfully

SettheportEthernet1/5accessvlan10successfully

SettheportEthernet1/6accessvlan10successfully

SettheportEthernet1/7accessvlan10successfully

SettheportEthernet1/8accessvlan10successfully

DCRS-7604(Config-Vlan10)#exit

DCRS-7604(Config)#vlan20

DCRS-7604(Config-Vlan20)#switchportinterfaceethernet1/9-16

SettheportEthernet1/9accessvlan20successfully

SettheportEthernet1/10accessvlan20successfully

 

SettheportEthernet1/11accessvlan20successfully

SettheportEthernet1/12accessvlan20successfully

SettheportEthernet1/13accessvlan20successfully

SettheportEthernet1/14accessvlan20successfully

SettheportEthernet1/15accessvlan20successfully

SettheportEthernet1/16accessvlan20successfully

DCRS-7604(Config-Vlan20)#exit

DCRS-7604(Config)#vlan100

DCRS-7604(Config-Vlan100)#switchportinterfaceethernet1/24

SettheportEthernet1/24accessvlan100successfully

DCRS-7604(Config-Vlan100)#exit

DCRS-7604(Config)#

验证配置:

DCRS-7604#showvlan

VLANNameTypeMediaPorts

---------------------------------------------------------------------------

1defaultStaticENETEthernet1/17Ethernet1/18

Ethernet1/19Ethernet1/20

Ethernet1/21Ethernet1/22

Ethernet1/23Ethernet1/25

Ethernet1/26Ethernet1/27

Ethernet1/28

10VLAN0010StaticENETEthernet1/1Ethernet1/2

Ethernet1/3Ethernet1/4

Ethernet1/5Ethernet1/6

Ethernet1/7Ethernet1/8

20VLAN0020StaticENETEthernet1/9Ethernet1/10

Ethernet1/11Ethernet1/12

Ethernet1/13Ethernet1/14

Ethernet1/15Ethernet1/16

100VLAN0100StaticENETEthernet1/24

DCRS-7604#

交换机B:

DCRS-5526S(Config)#vlan30

DCRS-5526S(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-5526S(Config-Vlan30)#exit

DCRS-5526S(Config)#vlan40

DCRS-5526S(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-5526S(Config-Vlan40)#exit

DCRS-5526S(Config)#vlan101

DCRS-5526S(Config-Vlan101)#switchportinterfaceethernet0/0/24

SettheportEthernet0/0/24accessvlan101successfully

DCRS-5526S(Config-Vlan101)#exit

DCRS-5526S(Config)#

验证配置:

DCRS-5526S#showvlan

VLANNameTypeMediaPorts

--------------------------------------------------------------------------

1defaultStaticENETEthernet0/0/17Ethernet0/0/18

Ethernet0/0/19Ethernet0/0/20

Ethernet0/0/21Ethernet0/0/22

Ethernet0/0/23

30VLAN0030StaticENETEthernet0/0/1Ethernet0/0/2

Ethernet0/0/3Ethernet0/0/4

Ethernet0/0/5Ethernet0/0/6

Ethernet0/0/7Ethernet0/0/8

40VLAN0040StaticENETEthernet0/0/9Ethernet0/0/10

Ethernet0/0/11Ethernet0/0/12

Ethernet0/0/13Ethernet0/0/14

Ethernet0/0/15Ethernet0/0/16

101VLAN0101StaticENETEthernet0/0/24

DCRS-5526S#

第二步:

配置交换机各vlan虚接口的IP地址(同实验27)

交换机A:

DCRS-7604(Config)#intvlan10

DCRS-7604(Config-If-Vlan10)#ipaddress192.168.10.1255.255.255.0

DCRS-7604(Config-If-Vlan10)#noshut

DCRS-7604(Config-If-Vlan10)#exit

DCRS-7604(Config)#intvlan20

DCRS-7604(Config-If-Vlan20)#ipaddress192.168.20.1255.255.255.0

 

DCRS-7604(Config-If-Vlan20)#noshut

DCRS-7604(Config-If-Vlan20)#exit

DCRS-7604(Config)#intvlan100

DCRS-7604(Config-If-Vlan100)#ipaddress192.168.100.1255.255.255.0

DCRS-7604(Config-If-Vlan100)#noshut

DCRS-7604(Config-If-Vlan100)#

DCRS-7604(Config-If-Vlan100)#exit

DCRS-7604(Config)#

交换机B:

DCRS-5526S(Config)#intvlan30

DCRS-5526S(Config-If-Vlan30)#ipaddress192.168.30.1255.255.255.0

DCRS-5526S(Config-If-Vlan30)#noshut

DCRS-5526S(Config-If-Vlan30)#exit

DCRS-5526S(Config)#interfacevlan40

DCRS-5526S(Config-If-Vlan40)#ipaddress192.168.40.1255.255.255.0

DCRS-5526S(Config-If-Vlan40)#exit

DCRS-5526S(Config)#intvlan101

DCRS-5526S(Config-If-Vlan101)#ipaddress192.168.100.2255.255.255.0

DCRS-5526S(Config-If-Vlan101)#exit

DCRS-5526S(Config)#

第三步:

配置各PC的IP地址,注意配置网关(同实验27)

 

设备

IP地址

gateway

Mask

PC1192.168.10.101

PC2192.168.20.101

192.168.10.1

192.168.20.1

255.255.255.0

255.255.255.0

PC3

192.168.30.101

192.168.30.1

255.255.255.0

PC4192.168.40.101192.168.40.1

第四步:

验证PC之间是否连通?

255.255.255.0

PC

端口

PC

端口

结果

原因

PC1

PC1

A:

1/1PC2

A:

1/1Vlan100

A:

1/9

A:

1/24

PC1

A:

1/1Vlan101

B:

0/0/24不通

PC1

A:

1/1PC3

B:

0/0/1

不通

 

查看路由表,进一步分析上一步的现象原因。

交换机A:

DCRS-7604#showiproute

Totalrouteitemsis3,thematchedrouteitemsis3

Codes:

C-connected,S-static,R-RIPderived,O-OSPFderived

A-OSPFASE,B-BGPderived,D-DVMRPderived

DestinationMaskNexthopInterfacePreference

 

C192.168.10.0255.255.255.00.0.0.0Vlan100

C192.168.20.0255.255.255.00.0.0.0Vlan200

C192.168.100.0255.255.255.00.0.0.0Vlan1000

DCRS-7604#

交换机B:

DCRS-5526S#showiproute

Totalrouteitemsis3,thematchedrouteitemsis3

Codes:

C-connected,S-static,R-RIPderived,O-OSPFderived

A-OSPFASE,B-BGPderived,D-DVMRPderived

DestinationMaskNexthopInterfacePreference

C192.168.30.0255.255.255.00.0.0.0Vlan300

C192.168.40.0255.255.255.00.0.0.0Vlan400

C192.168.100.0255.255.255.00.0.0.0Vlan1010

DCRS-5526S#

第五步:

启动OSPF协议,并将对应的直连网段配置到OSPF进程中

交换机A:

DCRS-7604(Config)#routerospf

OSPFprotocolisworking,pleasewaiting.......

OSPFprotocolhasenabled!

DCRS-7604(Config-Router-Ospf)#exit

DCRS-7604(Config)#interfacevlan10

DCRS-7604(Config-If-Vlan10)#ipospfenablearea0

DCRS-7604(Config-If-Vlan10)#

DCRS-7604(Config)#interfacevlan20

DCRS-7604(Config-If-Vlan20)#ipospfenablearea0

DCRS-7604(Config-If-Vlan20)#exit

DCRS-7604(Config)#interfacevlan100

DCRS-7604(Config-If-Vlan100)#

DCRS-7604(Config-If-Vlan100)#ipospfenablearea0

DCRS-7604(Config-If-Vlan100)#exit

DCRS-7604(Config)#

验证配置:

DCRS-7604#showiproute

Totalrouteitemsis4,thematchedrouteitemsis4

Codes:

C-connected,S-static,R-RIPderived,O-OSPFderived

A-OSPFASE,B-BGPderived,D-DVMRPderived

DestinationMaskNexthopInterfacePreference

C192.168.10.0255.255.255.00.0.0.0Vlan100

O192.168.30.0255.255.255.0192.168.100.2Vlan100110

O192.168.40.0255.255.255.0192.168.100.2Vlan100110

 

C192.168.100.0255.255.255.00.0.0.0Vlan1000

DCRS-7604#

(O代表ospf学习到的路由网段)

交换机B:

略(5526S的配置界面和7604是一样的)。

第六步:

验证PC之间是否连通?

PC

端口

PC

端口

结果

原因

PC1

PC1

A:

1/1PC2

A:

1/1Vlan100

A:

1/9

A:

1/24

PC1

A:

1/1Vlan101

B:

0/0/24通

PC1

A:

1/1PC3

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-7604#showrun

Currentconfiguration:

!

hostnameDCRS-7604

!

routerospf

!

telnet-useradminpassword0admin

!

Vlan1

vlan1

!

Vlan10

vlan10

 

!

Vlan20

vlan20

!

Vlan100

vlan100

!

InterfaceEthernet1/1

switchportaccessvlan10

!

InterfaceEthernet1/2

switchportaccessvlan10

!

InterfaceEthernet1/3

switchportaccessvlan10

!

InterfaceEthernet1/4

switchportaccessvlan10

!

InterfaceEthernet1/5

switchportaccessvlan10

!

InterfaceEthernet1/6

switchportaccessvlan10

!

InterfaceEthernet1/7

s

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高等教育 > 农学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2