当前位置:网站首页>配置基于接口的ARP表项限制和端口安全(限制用户私自接入傻瓜交换机或非法主机接入)
配置基于接口的ARP表项限制和端口安全(限制用户私自接入傻瓜交换机或非法主机接入)
2022-07-02 13:43:00 【文件皆一印】
应用场景:为了防止未授权用户接入网络、用户私自接入交换机、路由器等设备,给公司网络管理带来安全隐患。通过相关技术手段给予禁止,方法有如下二种:配置端口安全和配置基于接口的ARP表项限制
分别介绍二种方法的操作原理及配置:
一、端口安全:将设备端口学习到的动态MAC地址转换为安全MAC地址。在接口下使能此功能,并限制接口最大可学习的MAC表项数量,当超过设置值时,将丢弃后续用户的报文,从而确保接口的终端接入安全,增强设备安全性。
1.1 安全MAC地址分为以下三类:
(1)安全动态MAC地址(使能port-security但未使能Sticky,设备重启后表项会丢失,缺省情况下不会被老化,除非配置了老化时间)
(2)安全静态MAC地址(使能port-security时手工配置的静态MAC地址,不会被老化且设备重启表项不会丢失)
配置命令:port-security enable port-security mac-address 0001-0002-0003 vlan 10
(3)Sticky MAC地址(使能port-security且使能Sticky,不会被老化且设备重启表项不会丢失,推荐采用此种方式)
配置步骤(在接口视图下操作):
port-security enable
port-security mac-address sticky
port-security max-mac-num 10
port-security protect-action restrict
(4)端口安全的保护工作分为以下三种:
- restrict(丢弃,并上报告警,推荐采用此种方式)
- Protect(丢弃,不上报告警)
- Shutdown(接口状态修改为erro-down,并上报告警)
二、ARP表项限制:为了防止当一个接口所接入的某一用户主机发起ARP攻击时导致整个设备的ARP表资源被耗尽。在接口下配置接口能够学习到的最大动态ARP表项数量,超过此设置值后将不允许新增动态ARP表项。
场景1:ARP表项限制

LSW1上配置
#
配置接口GE0/0/1(LSW1)最多可以学习到2个VLAN10对应的动态ARP表项。
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
arp-limit vlan 10 maximum 2
#
或者配置接口VLANIF10最多可以学习到10个动态ARP表项。
#
interface Vlanif10
ip address 192.168.100.254 255.255.255.0
dhcp select interface
arp-limit maximum 10
#
在LSW1上执行display arp all查看ARP表项记录,只学习到PC1和PC2的ARP表项。

执行display arp-limit查看ARP限制表项记录

除了PC3无法访问192.168.100.254,PC1和PC2都可以访问。图忘截了。

场景2:配置端口安全

LSW2配置:
#
vlan batch 10
#
interface GigabitEthernet0/0/5
port link-type access
port default vlan 10
#
PC4和PC5是可以访问网络的


在LSW1上查看ARP表项

在GE0/0/5端口上开启端口安全后,再来观察PC4和PC5能否访问网关
[Huawei-GigabitEthernet0/0/5]port-security enable
[Huawei-GigabitEthernet0/0/5]port-security protect-action protect
[Huawei-GigabitEthernet0/0/5]port-security mac-address sticky
[Huawei-GigabitEthernet0/0/5]port-security max-mac-num 1
执行命令reboot,将LSW1重启,清除ARP表项(reset arp all命令在ENSP上无法使用)。

在PC4和PC5上分别测试能否访问网关192.168.100.254,发现只有PC4可以访问,PC5被拒绝了。


执行display arp all查看GE0/0/1接口下学习到的ARP条目

推荐:将端口安全保护功能更改restrict,在丢弃报文的同时上报告警。
[Huawei-GigabitEthernet0/0/5]port-security protect-action restrict
设备输出的报警如下
Jun 27 2022 01:32:25-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 13, t
he change loop count is 0, and the maximum number of records is 4095.
Jun 27 2022 01:32:32-08:00 Huawei L2IFPPI/4/PORTSEC_ACTION_ALARM:OID 1.3.6.1.4.1
.2011.5.25.42.2.1.7.6 The number of MAC address on interface (10/10) GigabitEthe
rnet0/0/5 reaches the limit, and the port status is : 1. (1:restrict;2:protect;3
:shutdown)
边栏推荐
- john爆破出現Using default input encoding: UTF-8 Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
- Global and Chinese markets for disposable insulin pumps 2022-2028: Research Report on technology, participants, trends, market size and share
- John blasting appears using default input encoding: UTF-8 loaded 1 password hash (bcrypt [blowfish 32/64 x3])
- Routing mode: hash and history mode
- 一文读懂AGV的关键技术——激光SLAM与视觉SLAM的区别
- LeetCode 6. Zigzag transformation (n-shaped transformation)
- 渗透工具-内网权限维持-Cobalt strike
- 小鹏P7雨天出事故安全气囊没有弹出 官方回应:撞击力度未达到弹出要求
- 数学分析_笔记_第6章:一元函数的Riemann积分
- PCL 最小中值平方法拟合平面
猜你喜欢

LeetCode 1. 两数之和

Sim2real environment configuration tutorial

【云原生】简单谈谈海量数据采集组件Flume的理解

数据安全产业系列沙龙(三)| 数据安全产业标准体系建设主题沙龙

unity Hub 登錄框變得很窄 無法登錄

pwm呼吸燈

Foreign enterprise executives, continuous entrepreneurs, yoga and skiing masters, and a program life of continuous iteration and reconstruction

Which software is good for machine vision?

Summary of monthly report | list of major events of moonbeam in June

⌈ 2022 ⌋ how to use webp gracefully in projects
随机推荐
Yolov5 practice: teach object detection by hand
LeetCode 1. 两数之和
LeetCode 4. 寻找两个正序数组的中位数(hard)
john爆破出现Using default input encoding: UTF-8 Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
数学分析_笔记_第5章:一元微分学
[North Asia data recovery] data recovery case of raid crash caused by hard disk disconnection during data synchronization of hot spare disk of RAID5 disk array
Cloud native cicd framework: Tekton
Yyds dry inventory executor package (parameter processing function)
一文读懂AGV的关键技术——激光SLAM与视觉SLAM的区别
The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 releases | geek headlines
Mathematical analysis_ Notes_ Chapter 5: univariate differential calculus
LeetCode 1. Sum of two numbers
vscode设置删除行快捷键[通俗易懂]
VMware安装win10镜像
隐私计算技术创新及产业实践研讨会:学习
TCP拥塞控制详解 | 2. 背景
月报总结|Moonbeam6月份大事一览
C语言中sprintf()函数的用法
Foreign enterprise executives, continuous entrepreneurs, yoga and skiing masters, and a program life of continuous iteration and reconstruction
unity Hub 登录框变得很窄 无法登录