华为初级路由交换实训测试

       我学习了华为基本的路由交换技术和简单的配置方法,所以网上找了一份实训题进行训练,里面会有错误,当然也有我不会配置的,今天分享上来是想与大家交流与学习。希望有大牛能够给予指正。

华为初级路由交换实训测试
一、基本配置

R1-R2-R3-R4-R5配置Loopback接口,编号均为0

操作步骤: [R1]interface LoopBack 0 
                   [R1-LoopBack0]ip add 10.1.1.1 24
                   [R2]interface LoopBack 0
                   [R2-LoopBack0]ip add 10.1.2.2 24
                   [R3]interfaceLoopBack 0
                   [R3-LoopBack0]ipadd 10.1.3.3 24     
                   [R4]interfaceLoopBack 0
                   [R4-LoopBack0]ip add 10.1.4.4 24
                   [R5]interfaceLoopBack 0
                   [R5-LoopBack0]ip add 10.1.5.5 24
网络设备及终端:

PC1

192.168.10.2/24

PC7

192.168.10.3/24

PC3

192.168.20.2/24

PC4

192.168.20.3/24

PC5

173.16.1.1/24

Server1

173.16.1.2/24

R1

S0/0/2

10.0.12.1/24

S0/0/2

10.0.12.2/24

R2

S0/0/2

10.0.2.2/24

G0/0/0

10.0.23.2/24

G0/0/1

10.0.24.1/24

R3

G0/0/0

10.0.23.3/24

G0/0/1

10.0.35.3/24

R4

G0/0/1

10.0.24.4/24

G0/0/2

10.0.45.4/24

R5

G0/0/1

10.0.35.5/24

G0/0/2

10.0.45.5/24



IP地址已固定给出,请按要求完成配置。


二、配置VLAN。
     1、PC1和PC7属于Vlan10,所属网络为192.168.10.0/24。
操作步骤:

创建VLAN10[S1]vlan 10                
设置端口类型:[S1-Ethernet0/0/2]port link-type access
                        [S1-Ethernet0/0/3]port link-type access
设置接口PVID[S1-Ethernet0/0/3]port default vlan 10
                         [S1-Ethernet0/0/3]port default vlan 10
二层与三层之间设置Trunk[S1-Ethernet0/0/3]int e0/0/4
                                           [S1-Ethernet0/0/4]port link-type trunk
                                           [S1-Ethernet0/0/4]port trunk allow-pass vlan all
      2、PC1和PC7属于Vlan10,所属网络为192.168.20.0/24。
操作步骤:

创建VLAN20[S2]vlan 20                
设置端口类型:[S2-Ethernet0/0/2]port link-type access
                        [S2-Ethernet0/0/3]port link-type access
设置接口PVID[S2-Ethernet0/0/3]port default vlan 20
                         [S2-Ethernet0/0/3]port default vlan 20
设置二层与三层交换接口为Trunk型:[S2-Ethernet0/0/3]int e0/0/4
                                                         [S2-Ethernet0/0/4]port link-type trunk
                                                         [S2-Ethernet0/0/4]port trunk allow-pass vlan all

  3.PC5和Server属于Vlan1,所属网络为173.16.1.0/24,连接主机主机的接口均为Access接口。
操作步骤:
创建VLAN1[S1]vlan 1                  
设置端口类型:[S5-Ethernet0/0/1]port link-type access
                        [S5-Ethernet0/0/2]port link-type access
设置接口PVID:[S5-Ethernet0/0/1]port default vlan 1
                         [S5-Ethernet0/0/2]port default vlan 1

配置Eth-trunk链路聚合

SW3SW4创建Eth-trunk 1连接
SW3 G0/0/1 G0/0/2 G0/0/3
操作步骤:

设置二层与三层交换接口为Trunk型:

[S3]int g0/0/4

[S3-GigabitEthernet0/0/4]port link-type trunk

[S3-GigabitEthernet0/0/4]port trunk allow-pass vlan all

[S3]int Eth-Trunk 1

[S3-Eth-Trunk1]mode manual

[S3-Eth-Trunk1]int g0/0/1

[S3-GigabitEthernet0/0/1]eth-trunk 1

[S3-GigabitEthernet0/0/1]int g0/0/2

[S3-GigabitEthernet0/0/2]eth-trunk 1

[S3-GigabitEthernet0/0/2]int g0/0/3

[S3-GigabitEthernet0/0/3]eth-trunk 1

SW4 G0/0/1 G0/0/7 G0/0/8
操作步骤:

设置二层与三层交换接口为Trunk型:

[S4]int g0/0/4                                            

[S4-GigabitEthernet0/0/4]port link-type trunk

[S4-GigabitEthernet0/0/4]port trunk allow-pass vlan all

[S4]int Eth-Trunk 1

[S4-Eth-Trunk1]mode manual

[S4-Eth-Trunk1]int g0/0/1

[S4-GigabitEthernet0/0/1]eth-trunk 1

[S4-GigabitEthernet0/0/1]int g0/0/7

[S4-GigabitEthernet0/0/7]eth-trunk 1

[S4-GigabitEthernet0/0/7]int g0/0/8

[S4-GigabitEthernet0/0/8]eth-trunk 1

四、部署MSTP instance 1 instance 2
SW3为instance 1的主要根桥,SW4为次要根桥
SW4为instance 2的主要根桥,SW3为次要根桥

VLAN10用户所属Instance1 
操作步骤:
[S3]stp region-configuration
[S3-mst-region]region-name mst-region
[S3-mst-region]instance 1 vlan 10
[S3-mst-region]instance 2 vlan 20
[S3-mst-region]active region-configuration
[S3]stp instance 1 root primary
[S3]stp instance 2 root secondary
[S3-mst-region]check region-configuration

VLAN20用户所属Instance2
操作步骤:
[S4]stp region-configuration
[S4-mst-region]region-name mst-region
[S4-mst-region]instance 1 vlan 10
[S4-mst-region]instance 2 vlan 20
[S4-mst-region]active region-configuration
[S4]stp instance 1 root secondary
[S4]stp instance 2 root primary
[S4-mst-region]check region-configuration

五、配置单区域OSPF路由协议

1.在路由器R1-R2-R3-R4-R5上配置 OSPF(进程 ID 1),router idLoopback 0接口地址。
2.将路由器上的所有对应网络宣告进Area 0中,包括Loopback0(排除R1SW3SW4之间的直连网段)
配置方法:
[R1]ospf router-id 10.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255


[R2]ospf router-id 10.1.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.0.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.0.24.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255


[R3]ospf router-id 10.1.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.0.23.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.0.35.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.3.0 0.0.0.255

[R4]ospf router-id 10.1.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.0.24.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 10.0.45.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 10.1.4.4 0.0.0.255

[R5]ospf router-id 10.1.5.5
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 10.0.35.0  0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 10.0.45.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network  10.1.5.5 0.0.0.255

六、OSPF调优
使用下列原则设置 OSPF 优先级:
R3R4绝不参与 DR/BDR 选举。R2 始终将成为 DR,并且优先级为最大值。
配置方法:
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf dr-priority 0
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ospf dr-priority 0

[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ospf dr-priority 0
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ospf dr-priority 0

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority255
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ospf dr-priority 255

七、部署RIPV2路由协议 (此处有我的两位同学给予帮助,感谢!)

1.在设备R1 SW3 SW4 上配置 RIPV2(进程 ID 1)。
2. 将设备上的所有对应网络宣告进RIP进程中。

配置步骤:

[R1]rip

[R1-rip-1]version 2

[R1-rip-1]network 192.168.10.0

[R1-rip-1]network 192.168.20.0


[S3]rip

[S3-rip-1]version 2

[S3-rip-1]network 10.0.0.0

[S3-rip-1]network 192.168.20.0


[S4]rip

[S4-rip-1]version 2

[S4-rip-1]network 10.0.0.0

[S4-rip-1]network 192.168.10.0


八、路由发布。 (此处有我的两位同学给予帮助,感谢!)
1、R1RIP路由发布到OSPF路由域中。
操作步骤:
[R1]rip
[R1-rip-1]version 2
[R1-rip-1]import-route ospf


2、R1设备发布默认路由到SW3、SW4.
操作步骤:
[S3]ospf
[S3-ospf-1]import-route rip
[S4]ospf
[S4-ospf-1]import-route rip

九、网络可靠性部署VRRP

SW3PC1 PC7PC3 PC4备份网关设备物理地址虚拟网关地址为:
Vlanif 10
Ip address 192.168.10.253/24
Vrrpvrid 1 virtual-ip 192.168.10.254  优先级xx关联上行端口并降低优先级xx MD5 密码 huawei 抢占时延 xxS 20s

配置操作:
[S3]vlan batch 10 20
[S3-Vlanif10]ip ad 192.168.10.253 24
[S3-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
[S3-Vlanif10]vrrp vrid 1 priority 150
[S3-Vlanif10]vrrp vrid 2 virtual-ip 192.168.10.1
[S3-Vlanif10]vrrp vrid 2 priority 100
[S3-Vlanif10]vrrp vrid 1 track interface GigabitEthernet 0/0/6 reduced 100
[S3-Vlanif10]vrrp vrid 1 preempt-mode timer delay 20
[S3-Vlanif10]vrrp vrid 1 authentication-mode MD5 huawei

Vlanif 20

Ip address 192.168.20.253/24
Vrrp vrid 2 virtual-ip 192.168.20.254优先级 xx MD5 密码 xx

配置操作:
[S3-Vlanif10]int vlanif 20
[S3-Vlanif20]ip ad 192.168.20.253 24
[S3-Vlanif20]vrrp vrid 1 virtual-ip 192.168.20.254
[S3-Vlanif20]vrrp vrid 1 priority 150
[S3-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[S3-Vlanif20]vrrp vrid 2 priority 100
[S3-Vlanif10]vrrp vrid 1 authentication-mode MD5 huawei


SW4PC1 PC7备份PC3 PC4主网关设备物理地址虚拟网关地址为:

Vlanif 10
Ip address 192.168.10.253/24
Vrrpvrid 1 virtual-ip 192.168.10.254 优先级 xx MD5 密码 xx

操作步骤:
[S4]vlan batch 10 20
[S4-Vlanif10]ip ad 192.168.10.253 24
[S4-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.254
[S4-Vlanif10]vrrp vrid 1 priority 150
[S4-Vlanif10]vrrp vrid 2 virtual-ip 192.168.10.1
[S4-Vlanif10]vrrp vrid 2 priority 100
[S4-Vlanif10]vrrp vrid 1 authentication-mode MD5 huawei

Vlanif 20
Ip address 192.168.20.253/24
Vrrpvrid 2 virtual-ip 192.168.20.254 优先级 xx关联上行端口并降低优先级 xx MD5 密码xx 抢占时延 20s
操作步骤:
[S4]vlan batch 10 20
[S4-Vlanif20]ip ad 192.168.10.253 24
[S4-Vlanif20]vrrp vrid 1 virtual-ip 192.168.20.254
[S4-Vlanif20]vrrp vrid 1 priority 150
[S4-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[S4-Vlanif20]vrrp vrid 2 priority 100
[S4-Vlanif20]vrrpvrid 1 track interface GigabitEthernet 0/0/6 reduced 100
[S4-Vlanif20]vrrp vrid 2 preempt-mode timer delay 20
[S4-Vlanif10]vrrp vrid 1 authentication-mode MD5 huawei


希望大家能够帮忙解决其中的问题,谢谢!!!

有解决方案的朋友可以在评论区回复,我会虚心请教!!!