网络设备安装与调试【2.4】

步骤 17:配置了 RIP 协议后,验证网络的连通性,如图 2-4-13 所示。

小贴士
神州数码的交换机在实现 RIP 路由协议时,宣告的是 VLAN 号。这点和其他厂商的设备
不太一样,且默认的版本号为 2,要特别注意。例如:

SwitchA(config)# router rip
SwitchA(config-router)#version 1
SwitchA(config-router)#network vlan 10
SwitchA(config-router)#network vlan 20
SwitchA(config-router)#network vlan 100	!VLAM的ID
!VLAM的ID
!VLAM的ID

知识拓展
RIPv2 动态路由协议实现时所需设备如下:
(1)DCRS-5650 交换机 2 台。
(2)PC 4 台。
(3)交叉线 1 条。
(4)直连线 4 条。
RIPv2 路由协议拓扑结构如图 2-4-14 所示。交换机和 PC 的 IP 地址网络参数设置见表 2-4-5。

步骤 1:按照图 2-4-14 连接网络拓扑结构。
步骤 2:按照表 2-4-5 配置计算机的 IP 地址、子网掩码和网关。
步骤 3:清空交换机的配置。

switch>enable !进入特权配置模式
switch#set default !恢复出厂设置
Are you sure?[Y/N] = y
switch#write
switch#reload !重启交换机
Process with reboot? [Y/N]y
步骤 4:在交换机 A 上划分 VLAN。
DCRS-5650-28>
DCRS-5650-28>enable
DCRS-5650-28#config
DCRS-5650-28(config)#hostname SwitchA
SwitchA(config)#vlan 10
SwitchA(Config-Vlan10)#switchport interface e0/0/1
Set the port Ethernet0/0/1 access vlan 10 successfully
SwitchA(Config-Vlan10)#exit
SwitchA(config)#vlan 20
SwitchA(Config-Vlan20)#switchport interface e0/0/2
Set the port Ethernet0/0/2 access vlan 20 successfully
SwitchA(Config-Vlan20)#exit
SwitchA(config)#vlan 100
SwitchA(Config-Vlan100)#switchport interface e0/0/24
Set the port Ethernet0/0/24 access vlan 100 successfully
SwitchA(Config-Vlan100)#exit
SwitchA(config)#
步骤 5:在交换机 B 上划分 VLAN。
DCRS-5650-28>
DCRS-5650-28>enable
DCRS-5650-28#config
DCRS-5650-28(config)#hostname SwitchB
SwitchB(config)#vlan 30
SwitchB(Config-Vlan30)#switchport interface e0/0/1
Set the port Ethernet0/0/1 access vlan 20 successfully
SwitchB(Config-Vlan30)#exit
SwitchB(config)#vlan 40
SwitchB(Config-Vlan40)#switchport interface e0/0/2
Set the port Ethernet0/0/2 access vlan 40 successfully
SwitchB(Config-Vlan40)#exit
SwitchB(config)#vlan 100
SwitchB(Config-Vlan100)#switchport interface e0/0/24
Set the port Ethernet0/0/24 access vlan 100 successfully
SwitchB(Config-Vlan100)#exit
SwitchB(config)#
步骤 6:在交换机 A 接口上配置 IP 地址。
SwitchA(config)#int vlan 10
SwitchA(Config-if-Vlan10)#ip add 172.16.0.1 255.255.255.0
SwitchA(Config-if-Vlan10)#no shut
SwitchA(Config-Vlan10)#exit
SwitchA(config)#int vlan 20
SwitchA(Config-if-Vlan20)#ip add 172.16.1.1 255.255.255.0
SwitchA(Config-if-Vlan20)#no shut
SwitchA(Config-Vlan20)#exit
SwitchA(config)#int vlan 100
SwitchA(Config-if-Vlan100)#ip add 172.16.100.1 255.255.255.0
SwitchA(Config-if-Vlan100)#no shut
SwitchA(Config-Vlan100)#exit
步骤 7:查看交换机 A 的接口 IP 地址配置情况。
SwitchA#show ip int brief
Index Interface IP-Address Status Protocol
2002 Loopback 127.0.0.1 up up
2004 Vlan10 172.16.0.1 up up
2005 Vlan20 172.16.1.1 up up
2006 Vlan100 172.16.100.1 up up
SwitchA#
步骤 8:在交换机 B 接口上配置 IP 地址。
SwitchB(config)#int vlan 30
SwitchB(Config-if-Vlan30)#ip add 172.16.2.1 255.255.255.0
SwitchB(Config-if-Vlan30)#no shut
SwitchB(Config-Vlan30)#exit
SwitchB(config)#int vlan 40
SwitchB(Config-if-Vlan40)#ip add 172.16.3.1 255.255.255.0
SwitchB(Config-if-Vlan40)#no shut
SwitchB(Config-Vlan40)#exit
SwitchB(config)#int vlan 100
SwitchB(Config-if-Vlan100)#ip add 172.16.100.2 255.255.255.0
SwitchB(Config-if-Vlan100)#no shut
SwitchB(Config-Vlan40)#exit
步骤 9:查看交换机 B 的接口 IP 地址配置情况。
SwitchB#show ip int brief
Index Interface IP-Address Status Protocol
2002 Loopback 127.0.0.1 up up
2004 Vlan30 172.16.2.1 up up
2005 Vlan40 172.16.3.1 up up
2006 Vlan100 172.16.100.2 up up
SwitchB#
步骤 10:查看未配置 RIPv2 路由协议的 SwitchA 的路由表。
SwitchA#show ip route
Codes: K - kernel, 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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
C 127.0.0.0/8 is directly connected, Loopback
C 172.16.0.0/24 is directly connected, Vlan10
C 172.16.1.0/24 is directly connected, Vlan20
C 172.16.100.0/24 is directly connected, Vlan100
Total routes are : 4 item(s)
SwitchA#
步骤 11:查看未配置 RIPv2 路由协议的 SwitchB 的路由表。
SwitchB#show ip route
Codes: K - kernel, 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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
C 127.0.0.0/8 is directly connected, Loopback
C 172.16.2.0/24 is directly connected, Vlan30
C 172.16.3.0/24 is directly connected, Vlan40
C 172.16.100.0/24 is directly connected, Vlan100
Total routes are : 4 item(s)
SwitchB#

步骤 12:配置路由协议前,同一个交换机的 VLAN 可以通信,不同交换机的 VLAN 无法通信,如图 2-4-15 所示。

步骤 13:在 SwitchA 上配置 RIP 路由协议。

SwitchA#config
SwitchA(config)# router rip
SwitchA(config-router)#network vlan 10
SwitchA(config-router)#network vlan 20
SwitchA(config-router)#network vlan 100
SwitchA(config-router)#
步骤 14:在 SwitchB 上配置 RIP 路由协议。
SwitchB#config
SwitchB(config)# router rip
SwitchB(config-router)#network vlan 30
SwitchB(config-router)#network vlan 40
SwitchB(config-router)#network vlan 100
SwitchB(config-router)#
步骤 15:查看配置了 RIPv2 路由协议的 SwitchA 的路由表。
SwitchA#show ip route
Codes: K - kernel, 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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
C 127.0.0.0/8 is directly connected, Loopback
C 172.16.0.0/24 is directly connected, Vlan10
C 172.16.1.0/24 is directly connected, Vlan20
R 172.16.2.0/24 [120/2] via 172.16.100.2, Vlan100, 00:00:15
R 172.16.3.0/24 [120/2] via 172.16.100.2, Vlan100, 00:00:15
C 172.16.100.0/24 is directly connected, Vlan100
Total routes are : 6 item(s)
SwitchA#

步骤 16:查看配置了 RIPv2 路由协议的 SwitchB 的路由表。 


SwitchB#show ip route
sho ip ro
Codes: K - kernel, 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, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default
C 127.0.0.0/8 is directly connected, Loopback
R 172.16.0.0/24 [120/2] via 172.16.100.1, Vlan100, 00:00:42
R 172.16.1.0/24 [120/2] via 172.16.100.1, Vlan100, 00:00:42
C 172.16.2.0/24 is directly connected, Vlan30
C 172.16.3.0/24 is directly connected, Vlan40
C 172.16.100.0/24 is directly connected, Vlan100
Total routes are : 6 item(s)
SwitchB#

步骤 17:配置了 RIP 协议后,验证网络的连通性,如图 2-4-16 所示。

学习小结
        本学习活动介绍了交换机之间如何实现 RIP 路由,需要注意的是 RIP 协议有两个版本— RIPv1 和 RIPv2, no auto-summary 功能只支持 RIPv2。宣告时只宣告自己的直连 VLAN,实现动态更新路由。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

BinaryStarXin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值