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

步骤实现
步骤 1:按照图 2-4-1 连接网络拓扑结构。
步骤 2:按照表 2-4-1 配置计算机的 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 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:查看交换机 A 上划分的 VLAN。
SwitchA#show vlan
VLAN Name Type Media Ports
---- ----------- --------- -------- ---------------------------------------
1 default Static ENET Ethernet0/0/2 Ethernet0/0/3
Ethernet0/0/4 Ethernet0/0/5
Ethernet0/0/6 Ethernet0/0/7
Ethernet0/0/8 Ethernet0/0/9
Ethernet0/0/10 Ethernet0/0/11
Ethernet0/0/12 Ethernet0/0/13
Ethernet0/0/14 Ethernet0/0/15
Ethernet0/0/16 Ethernet0/0/17
Ethernet0/0/18 Ethernet0/0/19
Ethernet0/0/20 Ethernet0/0/21
Ethernet0/0/22 Ethernet0/0/23
Ethernet0/0/25 Ethernet0/0/26
Ethernet0/0/27 Ethernet0/0/28
10 VLAN0010 Static ENET Ethernet0/0/1
100 VLAN0100 Static ENET Ethernet0/0/24
SwitchA#
步骤 6:在交换机 B 上划分 VLAN。
DCRS-5650-28>
DCRS-5650-28>enable
DCRS-5650-28#config
DCRS-5650-28(config)#hostname SwitchB
SwitchB(config)#vlan 20
SwitchB(Config-Vlan20)#exit
SwitchB(Config-Vlan20)#switchport interface e0/0/1
Set the port Ethernet0/0/1 access vlan 20 successfully
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)#
步骤 7:查看交换机 B 上划分的 VLAN。
SwitchB#show vlan
VLAN Name Type Media Ports
---- ----------- --------- -------- ---------------------------------------
1 default Static ENET Ethernet0/0/2 Ethernet0/0/3
Ethernet0/0/4 Ethernet0/0/5
Ethernet0/0/6 Ethernet0/0/7
Ethernet0/0/8 Ethernet0/0/9
Ethernet0/0/10 Ethernet0/0/11
Ethernet0/0/12 Ethernet0/0/13
Ethernet0/0/14 Ethernet0/0/15
Ethernet0/0/16 Ethernet0/0/17
Ethernet0/0/18 Ethernet0/0/19
Ethernet0/0/20 Ethernet0/0/21
Ethernet0/0/22 Ethernet0/0/23
Ethernet0/0/25 Ethernet0/0/26
Ethernet0/0/27 Ethernet0/0/28
20 VLAN0020 Static ENET Ethernet0/0/1
100 VLAN0100 Static ENET Ethernet0/0/24
SwitchB#

步骤 8:在交换机 A 接口上配置 IP 地址。

SwitchA(config)#int vlan 10
SwitchA(Config-if-Vlan10)#ip add 192.168.10.1 255.255.255.0
SwitchA(Config-if-Vlan10)#no shut
SwitchA(Config-Vlan10)#exit
SwitchA(config)#int vlan 100
SwitchA(Config-if-Vlan100)#ip add 192.168.100.1 255.255.255.0
SwitchA(Config-if-Vlan100)#no shut
SwitchA(Config-Vlan100)#exit

步骤 9:查看交换机 A 接口上的 IP 地址配置情况。

SwitchA#show ip int brief
Index Interface IP-Address Status Protocol
2002 Loopback 127.0.0.1 up up
2004 Vlan10 192.168.10.1 up up
2005 Vlan100 192.168.100.1 up up
SwitchA#

步骤 10:在交换机 B 接口上配置 IP 地址。

SwitchB(config)#int vlan 20
SwitchB(Config-if-Vlan20)#ip add 192.168.20.1 255.255.255.0
SwitchB(Config-if-Vlan20)#no shut
SwitchB(Config-Vlan20)#exit
SwitchB(config)#int vlan 100
SwitchB(Config-if-Vlan100)#ip add 192.168.100.2 255.255.255.0
SwitchB(Config-if-Vlan100)#no shut
SwitchB(Config-Vlan40)#exit

步骤 11:查看交换机 B 接口上的 IP 地址配置情况。

SwitchB#show ip int brief
Index Interface IP-Address Status Protocol
2002 Loopback 127.0.0.1 up up
2004 Vlan20 192.168.20.1 up up
2005 Vlan100 192.168.100.2 up up
SwitchB#

步骤 12:查看未配置静态路由协议时 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 192.168.10.0/24 is directly connected, Vlan10 !后面显示的是VLAN
C 192.168.100.0/24 is directly connected, Vlan100 !后面显示的是VLAN
Total routes are : 3 item(s)
SwitchA#

步骤 13:查看未配置静态路由协议时 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 192.168.20.0/24 is directly connected, Vlan20 !后面显示的是VLAN
C 192.168.100.0/24 is directly connected, Vlan100 !后面显示的是VLAN
Total routes are : 3 item(s)
SwitchB#

步骤 14:配置路由协议前,验证网络的连通性。
(1)在 PC1 上 ping 192.168.20.2,网络未连通,如图 2-4-2 所示。

(2)在 PC2 上 ping 192.168.10.2,网络未连通,如图 2-4-3 所示。

步骤 15:在 SwitchA 上配置静态路由。
SwitchA#config
SwitchA(config)#ip route 192.168.20.0 255.255.255.0 192.168.100.2
SwitchA#config
步骤 16:在 SwitchB 上配置静态路由。
SwitchB#config
SwitchB(config)#ip route 192.168.10.0 255.255.255.0 192.168.100.1
SwitchB#config

 步骤 17:查看配置了静态路由协议的 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 192.168.10.0/24 is directly connected, Vlan10 !后面显示的是VLAN
S 192.168.20.0/24 [1/0] via 192.168.100.2, Vlan100
!注意,静态路由的管理距离是1
C 192.168.100.0/24 is directly connected, Vlan100 !后面显示的是VLAN
Total routes are : 4 item(s)
SwitchA#

步骤 18:查看配置了静态路由协议的 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
S 192.168.10.0/24 [1/0] via 192.168.100.1, Vlan100
!注意,静态路由的管理距离是1,后面显示的是VLAN
C 192.168.20.0/24 is directly connected, Vlan20 !后面显示的是VLAN
C 192.168.100.0/24 is directly connected, Vlan100 !后面显示的是VLAN
Total routes are : 4 item(s)
SwitchB#

步骤 19:配置静态路由协议后,验证网络的连通性。
(1)在 PC1 上 ping 192.168.20.2,网络已连通,如图 2-4-4 所示。

(2)在 PC2 上 ping 192.168.10.2,网络已连通,如图 2-4-5 所示。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

BinaryStarXin

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

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

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

打赏作者

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

抵扣说明:

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

余额充值