Cyber_Security_Notes/A. 第一阶段/拓扑练习/0826_VRRP.md

90 lines
2.2 KiB
Markdown
Raw Normal View History

2024-08-27 17:15:42 +08:00
# VRRP
![image-20240827112252447](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/image-20240827112252447.png)
### 一、配PC的IP、子网掩码、网关
### 二、配路由交换机接口的IP、VLAN、VRRP
- **SW1**
```
<Huawei>u t m
<Huawei>sys
[Huawei]sys SW1
[SW1]vlan 10
[SW1-vlan10]quit
[SW1]port-group group-member g0/0/1 to g0/0/4
[SW1-port-group]port link-type access
[SW1-port-group]port default vlan 10
[SW1-port-group]return
<SW1>save
```
- **AR1**
```
<Huawei>u t m
<Huawei>sys
[Huawei]sys AR1
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip a 192.168.1.251 24
[AR1-GigabitEthernet0/0/0]int g0/0/1
[AR1-GigabitEthernet0/0/1]ip a 192.168.13.1 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[AR1-GigabitEthernet0/0/0]vrrp vrid 1 priority 130
[AR1-GigabitEthernet0/0/0]quit
[AR1]ip route-static 192.168.2.0 24 192.168.13.3
[AR1]quit
<AR1>save
```
- **AR2**
```
<Huawei>u t m
<Huawei>sys
[Huawei]sys AR2
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip a 192.168.1.252 24
[AR2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip a 192.168.23.1 24
[AR2-GigabitEthernet0/0/1]quit
[AR2]ip route-static 192.168.2.0 24 192.168.23.3
[AR2]quit
<AR2>save
```
- **AR3**
```
<Huawei>u t m
<Huawei>sys
[Huawei]sys AR3
[AR3]int g 0/0/0
[AR3-GigabitEthernet0/0/0]ip a 192.168.13.3 24
[AR3-GigabitEthernet0/0/0]int g0/0/1
[AR3-GigabitEthernet0/0/1]ip a 192.168.23.3 24
[AR3-GigabitEthernet0/0/1]int g0/0/2
[AR3-GigabitEthernet0/0/2]ip a 192.168.2.254 24
[AR3-GigabitEthernet0/0/2]quit
[AR3]ip route-static 192.168.1.0 24 192.168.23.1 preference 70
[AR3]quit
<AR3>save
```
### 三、拓展:上行接口监控(上行链路跟踪)
- **AR1**
```
[R1]int g0/0/0
[AR1-GigabitEthernet0/0/0]vrrp vrid 10 track int g0/0/1 reduced 50
```
> 配置 VRRP 跟踪功能,监视接口 g0/0/1 的状态。如果该接口故障VRRP 的优先级将减少 50
![批注 2024-08-27 113731](https://picgo-noriu.oss-cn-beijing.aliyuncs.com/Images/%E6%89%B9%E6%B3%A8%202024-08-27%20113731.png)