您的位置:首页 > 其它

三层交换机动态路由

2010-11-01 16:58 134 查看
实验二十九(1)、三层交换机RIP 动态路由

一、 实验目的

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

2、理解动态实现方式与静态方式的不同

二、 应用环境

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

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

三、 实验设备

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

2、DCRS-5526S交换机 1 台

3、PC机 2-4 台

4、Console 线1-2 根

5、直通网线 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

192.168.10.1 192.168.20.1 192.168.30.1 192.168.40.1 192.168.100.1 192.168.100.2

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

设备 IP 地址 gateway Mask

PC1 192.168.10.101 192.168.10.1 255.255.255.0

PC2 192.168.20.101 192.168.20.1 255.255.255.0

PC3 192.168.30.101 192.168.30.1 255.255.255.0

PC4 192.168.40.101 192.168.40.1 255.255.255.0

5、验证:

Set the port Ethernet1/11 access vlan 20 successfully

Set the port Ethernet1/12 access vlan 20 successfully

Set the port Ethernet1/13 access vlan 20 successfully

Set the port Ethernet1/14 access vlan 20 successfully

Set the port Ethernet1/15 access vlan 20 successfully

Set the port Ethernet1/16 access vlan 20 successfully

DCRS-7604(Config-Vlan20)#exit

DCRS-7604(Config)#vlan 100

DCRS-7604(Config-Vlan100)#switchport interface ethernet 1/24

Set the port Ethernet1/24 access vlan 100 successfully

DCRS-7604(Config-Vlan100)#exit

DCRS-7604(Config)#

验证配置:

DCRS-7604#show vlan

VLAN Name Type Media Ports

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

1 default Static ENET Ethernet1/17 Ethernet1/18

Ethernet1/19 Ethernet1/20

Ethernet1/21 Ethernet1/22

Ethernet1/23 Ethernet1/25

Ethernet1/26 Ethernet1/27

Ethernet1/28

10 VLAN0010 Static ENET Ethernet1/1 Ethernet1/2

Ethernet1/3 Ethernet1/4

Ethernet1/5 Ethernet1/6

Ethernet1/7 Ethernet1/8

20 VLAN0020 Static ENET Ethernet1/9 Ethernet1/10

Ethernet1/11 Ethernet1/12

Ethernet1/13 Ethernet1/14

Ethernet1/15 Ethernet1/16

100 VLAN0100 Static ENET Ethernet1/24

DCRS-7604#

交换机B:

DCRS-5526S(Config)#vlan 30

DCRS-5526S(Config-Vlan30)#switchport interface ethernet 0/0/1-8

Set the port Ethernet0/0/1 access vlan 30 successfully

Set the port Ethernet0/0/2 access vlan 30 successfully

Set the port Ethernet0/0/3 access vlan 30 successfully

Set the port Ethernet0/0/4 access vlan 30 successfully

Set the port Ethernet0/0/5 access vlan 30 successfully

Set the port Ethernet0/0/6 access vlan 30 successfully

Set the port Ethernet0/0/7 access vlan 30 successfully

Set the port Ethernet0/0/8 access vlan 30 successfully DCRS-5526S(Config-Vlan30)#exit

DCRS-5526S(Config)#vlan 40

DCRS-5526S(Config-Vlan40)#switchport interface ethernet 0/0/9-16

Set the port Ethernet0/0/9 access vlan 40 successfully

Set the port Ethernet0/0/10 access vlan 40 successfully

Set the port Ethernet0/0/11 access vlan 40 successfully

Set the port Ethernet0/0/12 access vlan 40 successfully

Set the port Ethernet0/0/13 access vlan 40 successfully

Set the port Ethernet0/0/14 access vlan 40 successfully

Set the port Ethernet0/0/15 access vlan 40 successfully

Set the port Ethernet0/0/16 access vlan 40 successfully

DCRS-5526S(Config-Vlan40)#exit

DCRS-5526S(Config)#vlan 101

DCRS-5526S(Config-Vlan101)#switchport interface ethernet 0/0/24

Set the port Ethernet0/0/24 access vlan 101 successfully

DCRS-5526S(Config-Vlan101)#exit

DCRS-5526S(Config)#

验证配置:

DCRS-5526S#show vlan

VLAN Name Type Media Ports

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

1 default Static ENET Ethernet0/0/17 Ethernet0/0/18

Ethernet0/0/19 Ethernet0/0/20

Ethernet0/0/21 Ethernet0/0/22

Ethernet0/0/23

30 VLAN0030 Static ENET Ethernet0/0/1 Ethernet0/0/2

Ethernet0/0/3 Ethernet0/0/4

Ethernet0/0/5 Ethernet0/0/6

Ethernet0/0/7 Ethernet0/0/8

40 VLAN0040 Static ENET Ethernet0/0/9 Ethernet0/0/10

Ethernet0/0/11 Ethernet0/0/12

Ethernet0/0/13 Ethernet0/0/14

Ethernet0/0/15 Ethernet0/0/16

101 VLAN0101 Static ENET Ethernet0/0/24

DCRS-5526S#

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

交换机A:

DCRS-7604(Config)#int vlan 10

DCRS-7604(Config-If-Vlan10)#ip address 192.168.10.1 255.255.255.0

DCRS-7604(Config-If-Vlan10)#no shut

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

DCRS-7604(Config)#int vlan 20

DCRS-7604(Config-If-Vlan20)#ip address 192.168.20.1 255.255.255.0 DCRS-7604(Config-If-Vlan20)#no shut

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

DCRS-7604(Config)#int vlan 100

DCRS-7604(Config-If-Vlan100)#ip address 192.168.100.1 255.255.255.0

DCRS-7604(Config-If-Vlan100)#no shut

DCRS-7604(Config-If-Vlan100)#

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

DCRS-7604(Config)#

交换机B:

DCRS-5526S(Config)#int vlan 30

DCRS-5526S(Config-If-Vlan30)#ip address 192.168.30.1 255.255.255.0

DCRS-5526S(Config-If-Vlan30)#no shut

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

DCRS-5526S(Config)#interface vlan 40

DCRS-5526S(Config-If-Vlan40)#ip address 192.168.40.1 255.255.255.0

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

DCRS-5526S(Config)#int vlan 101

DCRS-5526S(Config-If-Vlan101)#ip address 192.168.100.2 255.255.255.0

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

DCRS-5526S(Config)#

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

设备 IP 地址 gateway Mask

PC1 192.168.10.101 192.168.10.1 255.255.255.0

PC2 192.168.20.101 192.168.20.1 255.255.255.0

PC3 192.168.30.101 192.168.30.1 255.255.255.0

PC4 192.168.40.101 192.168.40.1 255.255.255.0

第四步:验证PC之间是否连通?

PC 端口 PC 端口 结果 原因

PC1 A:1/1 PC2 A:1/9 通

PC1 A:1/1 Vlan 100 A:1/24 通

PC1 A:1/1 Vlan 101 B:0/0/24 不通

PC1 A:1/1 PC3 B:0/0/1 不通

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

交换机A:

DCRS-7604#show ip route

Total route items is 3, the matched route items is 3

Codes: C - connected, S - static, R - RIP derived, O - OSPF derived

A - OSPF ASE, B - BGP derived, D - DVMRP derived

Destination Mask Nexthop Interface Preference C 192.168.10.0 255.255.255.0 0.0.0.0 Vlan10 0

C 192.168.20.0 255.255.255.0 0.0.0.0 Vlan20 0

C 192.168.100.0 255.255.255.0 0.0.0.0 Vlan100 0

DCRS-7604#

交换机B:

DCRS-5526S#show ip route

Total route items is 3, the matched route items is 3

Codes: C - connected, S - static, R - RIP derived, O - OSPF derived

A - OSPF ASE, B - BGP derived, D - DVMRP derived

Destination Mask Nexthop Interface Preference

C 192.168.30.0 255.255.255.0 0.0.0.0 Vlan30 0

C 192.168.40.0 255.255.255.0 0.0.0.0 Vlan40 0

C 192.168.100.0 255.255.255.0 0.0.0.0 Vlan101 0

DCRS-5526S#

第五步:启动RIP协议,并将对应的直连网段配置到RIP进程中

交换机A:

DCRS-7604(Config)#router rip

DCRS-7604(Config-Router-Rip)#version 2

DCRS-7604(Config)#interface vlan 10

DCRS-7604(Config-If-Vlan10)#ip rip work

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

DCRS-7604(Config)#interface vlan 20

DCRS-7604(Config-If-Vlan20)#ip rip work

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

DCRS-7604(Config)#interface vlan 100

DCRS-7604(Config-If-Vlan100)#ip rip work

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

验证配置:

DCRS-7604#show ip rip

RIP information:

Automatic network summarization is not in effect.

default metric for redistribute is :1.

neighbour is :NULL

preference is :120

RIP version information is :

interface send version receive version

Vlan10 V2MC V2

Vlan20 V2MC V2

Vlan100 V2MC V2

DCRS-7604#

DCRS-7604#show ip route Total route items is 4, the matched route items is 4

Codes: C - connected, S - static, R - RIP derived, O - OSPF derived

A - OSPF ASE, B - BGP derived, D - DVMRP derived

Destination Mask Nexthop Interface Preference

C 192.168.10.0 255.255.255.0 0.0.0.0 Vlan10 0

R 192.168.30.0 255.255.255.0 192.168.100.2 Vlan100 120

R 192.168.40.0 255.255.255.0 192.168.100.2 Vlan100 120

C 192.168.100.0 255.255.255.0 0.0.0.0 Vlan100 0

DCRS-7604#

(R表示rip协议学习到的网段)

交换机B:

DCRS-5526S(Config)#router rip

DCRS-5526S(Config-Router-Rip)#version 2

DCRS-5526S(Config-Router-Rip)#exit

DCRS-5526S(Config)#interface vlan 30

DCRS-5526S(Config-If-Vlan30)#ip rip work

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

DCRS-5526S(Config)#interface vlan 40

DCRS-5526S(Config-If-Vlan40)#ip rip work

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

DCRS-5526S(Config)#interface vlan 101

DCRS-5526S(Config-If-Vlan101)#ip rip work

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

DCRS-5526S(Config)#

验证配置:

DCRS-5526S#show ip rip

RIP information:

Automatic network summarization is not in effect.

default metric for redistribute is :1.

neighbour is :NULL

preference is :120

RIP version information is :

interface send version receive version

Vlan30 V2MC V2

Vlan40 V2MC V2

Vlan101 V2MC V2

DCRS-5526S#

DCRS-5526S#show ip route

Total route items is 4, the matched route items is 4

Codes: C - connected, S - static, R - RIP derived, O - OSPF derived

A - OSPF ASE, B - BGP derived, D - DVMRP derived

Destination Mask Nexthop Interface Preference R 192.168.10.0 255.255.255.0 192.168.100.1 Vlan101 120

C 192.168.30.0 255.255.255.0 0.0.0.0 Vlan30 0

C 192.168.40.0 255.255.255.0 0.0.0.0 Vlan40 0

C 192.168.100.0 255.255.255.0 0.0.0.0 Vlan101 0

DCRS-5526S#

(R表示rip协议学习到的网段)

第六步:验证PC之间是否连通?

PC 端口 PC 端口 结果 原因

PC1 A:1/1 PC2 A:1/9 通

PC1 A:1/1 Vlan 100 A:1/24 通

PC1 A:1/1 Vlan 101 B:0/0/24 通

PC1 A:1/1 PC3 B:0/0/1 通
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息