在华为eNSP中配置VRRP与MSTP协议

一、简介:

1、什么是VRRP:

(1)VRRP(Virtual Router Redundancy Protocol)的概念:

  VRRP(Virtual Router Redundancy Protocol)指的是一种实现路由器冗余备份的协议,常用于构建局域网内的高可用性、无故障转移的网络拓扑。通过使用 VRRP,可以将多个路由器构成一个虚拟路由器,对外提供单一的虚拟 IP 地址和 MAC 地址,其中一个路由器被选举为虚拟路由器的主机,而其他路由器则被定义为热备份。

(2)VRRP(Virtual Router Redundancy Protocol)的作用:

在 VRRP 中,每个实际路由器都拥有一个默认优先级,当网络上出现故障(如主路由器无法继续提供服务),热备份路由器会被自动顶替为新的主路由器,保证网络服务的持续性。

(3)VRRP(Virtual Router Redundancy Protocol)的概括:

简单来说,VRRP 可以将多个物理路由器组成一个虚拟路由器,避免单点故障和网络中断的发生,实现路由器的高可用性和无故障切换。

2、什么是MSTP:

(1)MSTP(Multiple Spanning Tree Protocol)的概念:

MSTP(Multiple Spanning Tree Protocol)指的是一种基于标准 STP(Spanning Tree Protocol)的扩展协议,用于网络中多个 VLAN 的环路问题。它可以将多个 VLAN 拥有相同的网关交换机时,将这些 VLAN 网络同时连入并隔离 STP,形成多个独立的 STP 实例,从而避免一个 STP 实例影响整个网络的工作。

(2)MSTP(Multiple Spanning Tree Protocol)的作用:

在一些使用 VLAN 环境中,所有 STP 发生变化时,可能会出现链路或者网络出现抖动或断开的情况,企业需要做出升级或者增加网络设备的变化。MSTP 常用于解决这种问题,它能够在网络中对于子网及其上的路径进行分类,并提供控制机制进行统一管理。

(3)MSTP(Multiple Spanning Tree Protocol)的概括:

简单来说,MSTP 可以通过将每个 VLAN 网络独立成 STP 实例的方式,解决多个 VLAN 网络之间的环路问题,避免不同 VLAN 网络之间互相影响。这样可以提高网络环境下的可用性与可靠性,促进企业网络的稳定化运行。

二、要求:

实验所需要的拓补图:

首先,你需要在ensp软件中创建一个拓扑图。在创建拓扑图时,你需要添加一个路由器、四台主机、两台三层交换机以及两台两层交换机。创建完成后,全部都开始启动,然后确保你的拓扑图中的设备能够正常连接和通信。

网络规划:


(1)交换机之间的接口全部为 Trunk 类型。
(2)在 SW1和 SW2 上配置 VRRP,Master 路由器优先级为 150,Backup 路由器优先级为 110。当Master 路由器的上行接口出现故障,其优先级减少 70,实现由 Master 路由器到 Backup 路由器的切换。
(3)在 Sw1 交换机上配置 VLAN 接口IP地址:
VLAN2 接口的 IP地址: 192.168.2.1/24
VLAN3 接口的 IP地址: 192.168.3.1/24
VLAN4 接口的 IP地址: 192.168.4.1/24
(4)在 Sw2 交换机上配置 VLAN 接口IP地址:

VLAN2 接口的IP地址: 192.168.2.2/24 

VLAN3 接口的 IP地址: 192.168.3.2/24 

 VLAN4 接口的IP地址: 192.168.4.2/24

(5) PC的P 地址及网关如下: 
PC1的IP地址: 192.168.2.10/24,网关为 192.168.2.254/24
PC2的IP地址: 192.168.3.10/24,网关为192.168.3.254/24
PC3的IP地址: 192.168.2.11/24,网关为 192.168.2.254/24
PC4的IP地址: 192.168.4.10/24,网关为 192.168.4.254/24
(6) SW1 与 NAT 网段: 192.168.100.0/30,SW2 与NAT 网段: 192.168.100.4/30,NAT 上用 Loopback0 模拟 Internet,IP地址为 222.103.255.1/30

三、配置PC端的基础配置

PC1的参数配置:

 PC2的参数配置:

PC3的参数配置:

PC4的参数配置:

 四、配置S1和S2的VRRP

1、S1参数配置:

S1配置:
sys
sysname S1
undo info enable
vlan batch 2 3 4 100
interface vlanif 2
ip address 192.168.2.1 24
vrrp vrid 2 virtual-ip 192.168.2.254
vrrp vrid 2 priority 150
vrrp vrid 2 preempt-mode timer delay 1
vrrp vrid 2 timer advertise 1
vrrp vrid 2 track interface GigabitEthernet 0/0/1 reduced 70
interface vlanif 3
ip address 192.168.3.1 24
vrrp vrid 3 virtual-ip 192.168.3.254
vrrp vrid 3 priority 110
vrrp vrid 3 preempt-mode timer delay 1
vrrp vrid 3 timer advertise 1
interface vlanif 4
ip address 192.168.4.1 24
vrrp vrid 4 virtual-ip 192.168.4.254
vrrp vrid 4 priority 110
vrrp vrid 4 preempt-mode timer delay 1
vrrp vrid 4 timer advertise 1

2、S2参数配置:

S2配置:
sys
sysname S2
undo info enable
vlan batch 2 3 4 100
interface vlanif 2
ip address 192.168.2.2 24
vrrp vrid 2 virtual-ip 192.168.2.254
vrrp vrid 2 priority 110
vrrp vrid 2 preempt-mode timer delay 1
vrrp vrid 2 timer advertise 1
interface vlanif 3
ip address 192.168.3.2 24
vrrp vrid 3 virtual-ip 192.168.3.254
vrrp vrid 3 priority 150
vrrp vrid 3 preempt-mode timer delay 1
vrrp vrid 3 timer advertise 1
vrrp vrid 3 track interface GigabitEthernet 0/0/1 reduced 70
interface vlanif 4
ip address 192.168.4.2 24
vrrp vrid 4 virtual-ip 192.168.4.254
vrrp vrid 4 priority 150
vrrp vrid 4 preempt-mode timer delay 1
vrrp vrid 4 timer advertise 1
vrrp vrid 4 track interface GigabitEthernet 0/0/1 reduced 70

五、配置S1、S2、S3、S4的链路

1、S1的参数配置:

S1配置:
interface vlanif 100
ip address 192.168.100.1 30
interface GigabitEthernet 0/0/1
port link-type access 
port default vlan 100
interface GigabitEthernet 0/0/13
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/0/14
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/0/15
port link-type trunk
port trunk allow-pass vlan all

2、S2的参数配置:

S2配置:
interface vlanif 100
ip address 192.168.100.5 30
interface GigabitEthernet 0/0/1
port link-type access 
port default vlan 100
interface GigabitEthernet 0/0/13
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/0/14
port link-type trunk
port trunk allow-pass vlan all
interface GigabitEthernet 0/0/15
port link-type trunk
port trunk allow-pass vlan all

3、S3的参数配置:

S3配置:
sys
sysname S3
undo info enable
vlan batch 2 3 4 100
interface Ethernet0/0/13
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet0/0/14
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet 0/0/1
port link-type access 
port default vlan 2
interface Ethernet 0/0/2
port link-type access 
port default vlan 3

4、S4的参数配置:

S4配置:
sys
sysname S4
undo info enable
vlan batch 2 3 4 100
interface Ethernet0/0/13
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet0/0/14
port link-type trunk
port trunk allow-pass vlan all
interface Ethernet 0/0/1
port link-type access 
port default vlan 2
interface Ethernet 0/0/2
port link-type access 
port default vlan 4

六、配置S1、S2、S3、S4的MSTP

1、S1的参数配置:

S1配置:
stp region-configuration
region-name STP
instance 1 vlan 2
instance 2 vlan 3 4
revision-level 1
active region-configuration
stp root primary 

2、S2的参数配置:

S2配置:
stp region-configuration
region-name STP
instance 1 vlan 2
instance 2 vlan 3 4
revision-level 1
active region-configuration
stp root secondary

3、S3的参数配置:

S3配置:
stp region-configuration
region-name STP
instance 1 vlan 2
instance 2 vlan 3 4
revision-level 1
active region-configuration
stp instance 1 root primary
stp instance 2 root secondary

4、S4的参数配置:

S4配置:
stp region-configuration
region-name STP
instance 1 vlan 2
instance 2 vlan 3 4
revision-level 1
active region-configuration
stp instance 2 root primary
stp instance 1 root secondary

七、配置R1的参数以及R1、S1、S2的静态路由:

1、R1的参数配置:

R1配置:
sys
undo info-center enable
sysname R1
interface GigabitEthernet 0/0/0
ip address 192.168.100.6 30
interface GigabitEthernet 0/0/1
ip address 192.168.100.2 30
interface LoopBack 0
ip address 222.103.225.1 30
ip route-static 192.168.2.0 24 192.168.100.1
ip route-static 192.168.3.0 24 192.168.100.5
ip route-static 192.168.4.0 24 192.168.100.5

2、S1的参数配置:

S1配置:
ip route-static 192.168.100.4 30 192.168.100.2
ip route-static 222.103.225.0 30 192.168.100.2

3、S2的参数配置:

S2配置:
ip route-static 192.168.100.0 30 192.168.100.6
ip route-static 222.103.225.0 30 192.168.100.6

八、验证:

1、查看MSTP

查看MSTP可以用display stp brief

 

2、查看VRRP

查看VRRP可以用display vrrp brief

 

3、查看PC端是否可以ping通全网以及LoopBack的外网

LoopBack外网:

Ping全网:

试验完成后需要保存需在每个交换机上ctal+z退出操作权限,然后再save保存。 

猜你喜欢

转载自blog.csdn.net/Sword_of_despair/article/details/131045506
今日推荐