侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

ACL应用之VRRP

2023-03-27 星期一 / 0 评论 / 0 点赞 / 68 阅读 / 6619 字

ACL应用之VRRPVRRP发送报文方式是什么?组播 地址:224.0.0.18VRRP报文是由哪个设备发送的?master 主路由设备发送VRRP的报文协议号是多少?112可能存在的一种ACL拒绝V

.

ACL应用之VRRP

VRRP发送报文方式是什么?
组播 地址:224.0.0.18
VRRP报文是由哪个设备发送的?
master 主路由设备发送
VRRP的报文协议号是多少?
112
可能存在的一种ACL拒绝VRRP报文产生MASTER错误的情况
案例
1.如图配置IP地址
2.配置 VRRP 虚拟网关和优先级
3.配置 ACL 确保 R2 也成为 Master
-acl不能控制自己发出流量所以要在r2设置acl
4.确保其他类型的流量可以互通
-因为要确保所有流量互通所以不能用ip协议
-所以需要使用高级ACL针对性阻止vrrp报文进入

5 案例5:ACL 应用之VRRP

5.1 问题
如图配置IP地址
配置 VRRP 虚拟网关和优先级
配置 ACL 确保 R2 也成为 Master
确保其他类型的流量可以互通
5.2 方案
搭建实验环境,如图-5所示。

图-5

5.3 步骤
实现此案例需要按照如下步骤进行。

1)配置终端设备 – PC1

  地址:192.168.1.1  掩码:255.255.255.0  网关:192.168.1.254 // 虚拟网关IP地址

2)配置网络设备 – SW1

<Huawei>system-view // 进入系统视图
[Huawei]sysname SW1 // 修改设备名称为 SW1
[SW1] vlan 10 // 创建 vlan 10
[SW1-vlan10]quit
[SW1]interface GigabitEthernet 0/0/1 // SW1 与 R1 的互联接口
[SW1-GigabitEthernet0/0/1]port link-type access // 配置链路类型为 access
[SW1-GigabitEthernet0/0/1]port default vlan 10 // 将端口加入 vlan 10
[SW1-GigabitEthernet0/0/1]quit
[SW1]interface gi0/0/2 // SW1 与 R2 的互联接口
[SW1-GigabitEthernet0/0/2]port link-type access // 配置链路类型为 access
[SW1-GigabitEthernet0/0/2]port default vlan 10 // 将端口加入 vlan 10
[SW1-GigabitEthernet0/0/2]quit
[SW1]interface gi0/0/3 // SW1 与 PC1 的互联接口
[SW1-GigabitEthernet0/0/3]port link-type access // 配置链路类型为 access
[SW1-GigabitEthernet0/0/3]port default vlan 10 // 将端口加入 vlan 10
[SW1-GigabitEthernet0/0/3]quit
3)配置网络设备 – R1 和 VRRP

<Huawei>system-view // 进入系统模式
[Huawei]sysname R1 // 更改设备名称
[R1]interface gi0/0/0 // 连接 SW1 的接口
[R1-GigabitEthernet0/0/0] ip address 192.168.1.251 24
[R1-GigabitEthernet0/0/0] vrrp vrid 1 virtual-ip 192.168.1.254 // 配置 VRRP
[R1-GigabitEthernet0/0/0] vrrp vrid 1 priority 200 // 配置主网关优先级
[R1-GigabitEthernet0/0/0] quit
4)配置网络设备 – R2 和 VRRP

<Huawei>system-view // 进入系统模式
[Huawei]sysname R2 // 更改设备名称
[R2]interface gi0/0/0 // 连接 SW1 的接口
[R2-GigabitEthernet0/0/0] ip address 192.168.1.252 24
[R2-GigabitEthernet0/0/0] vrrp vrid 1 virtual-ip 192.168.1.254 // 配置 VRRP
[R2-GigabitEthernet0/0/0] vrrp vrid 1 priority 150 // 配置备份网关优先级
[R2-GigabitEthernet0/0/0] quit
5)验证 VRRP

[R1]display vrrp brief // 主网关
Total:1 Master:1 Backup:0 Non-active:0
VRID State Interface Type Virtual IP

1 Master GE0/0/0 Normal 192.168.1.254
[R2]display vrrp brief // 备份网关
Total:1 Master:0 Backup:1 Non-active:0
VRID State Interface Type Virtual IP

1 Backup GE0/0/0 Normal 192.168.1.254
6)在 R2 上配置并调用 ACL ,拒绝 R1 发送 VRRP

[R2] acl 3002
[R2-acl-adv-3002]rule 10 deny 112 source 192.168.1.251 0 destination 224.0.0.18 0
// 拒绝 R1 发送的 VRRP 报文
[R2] interface gi0/0/0
[R2-GigabitEthernet0/0/0] traffic-filter inbound acl 3002 // 接口入向调用ACL
7)再次验证 VRRP (R1和R2均为Master)

[R1]display vrrp brief // 主网关
Total:1 Master:1 Backup:0 Non-active:0
VRID State Interface Type Virtual IP

1 Master GE0/0/0 Normal 192.168.1.254
[R2]display vrrp brief // 主网关
Total:1 Master:0 Backup:1 Non-active:0
VRID State Interface Type Virtual IP

1 Master GE0/0/0 Normal 192.168.1.254

VRRP多master的常见原因:

1.IP地址必须相同
2.vrid必须相同
3.virtual-ip(虚拟ip)必须相同
4.认证必须成功
5.通过ACL拒绝vrrp报文后备份网关自动变成网关

[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.251 24
[R1-GigabitEthernet0/0/0]q
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R1-GigabitEthernet0/0/0]vrrp vrid 1 priority 200
[R1-GigabitEthernet0/0/0]q

<R1>telnet 192.168.1.252
Press CTRL_] to quit telnet mode
Trying 192.168.1.252 ...
Connected to 192.168.1.252 ...

Login authentication

Pasword:

[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.252 24
[R2-GigabitEthernet0/0/0]q
[R2]ping 192.168.1.251
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.254
[R2-GigabitEthernet0/0/0]vrrp vrid 1 priority 150
[R2-GigabitEthernet0/0/0]q
[R2]dis vrrp b
[R2]acl 3000
[R2-acl-adv-3000]rule 10 deny 112 source 192.168.1.251 0.0.0.0 destination 224.0
.0.18 0.0.0.0
[R2-acl-adv-3000]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]traffic-filter inbound acl 3000
[R2-GigabitEthernet0/0/0]q
[R2]dis vrrp b
Total:1 Master:1 Backup:0 Non-active:0
VRID State Interface Type Virtual IP

1 Master GE0/0/0 Normal 192.168.1.254
[R2]dis acl all
rule 10 deny 112 source 192.168.1.251 0 destination 224.0.0.18 0 (22 matches)
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode pas
Please configure the login pas (maximum length 16):HCIE
[R2-ui-vty0-4]q

.

广告 广告

评论区