交换机的端口安全配置
- 格式:doc
- 大小:105.50 KB
- 文档页数:8
浅谈交换机安全配置随着网络安全问题的日益凸显,交换机作为网络设备中的重要组成部分,其安全配置显得尤为重要。
交换机是用来连接网络中各种终端设备的设备,它负责数据的传输和路由,因此交换机的安全性关乎整个网络的安全。
本文将浅谈交换机安全配置,希望对读者有所帮助。
一、交换机安全威胁首先我们需要了解交换机面临的安全威胁。
交换机可能会受到来自外部的攻击,比如黑客通过网络攻击来入侵交换机,获取网络数据或者干扰正常的网络通讯。
内部的员工也可能利用技术手段对交换机进行非法操作,比如窃取公司的敏感数据等。
交换机的安全配置必不可少。
二、交换机安全配置策略1.访问控制访问控制是保障交换机安全的重要手段之一。
通过访问控制列表(ACL)可以对交换机的流量进行控制和过滤,防止未经授权的用户对网络数据进行访问和操作。
管理员可以根据需要设置ACL,比如限制某些IP地址的访问,屏蔽特定的端口等,以达到控制流量的目的。
还可以通过VLAN和端口安全控制来对交换机的端口进行访问控制,保障网络的安全性。
2.端口安全交换机端口是连接终端设备的关键接口,因此需要对端口进行安全配置。
管理员可以通过设置端口安全策略来限制端口的访问权限,比如限制每个端口允许连接的MAC地址数量,当超出限制时自动关闭端口,防止未经授权的设备连接到网络上。
还可以配置端口安全的认证机制,比如802.1x认证,只有通过认证的设备才能接入网络,提高网络的安全性。
3.密钥管理交换机通过密钥来进行认证和加密,因此密钥管理是交换机安全配置中的关键步骤。
管理员需要对交换机的密钥进行合理的管理和保护,确保其不被泄露或被非法使用。
密钥的定期更新也是一项重要的措施,可以有效防止攻击者利用已知的密钥进行网络攻击。
4.端口镜像端口镜像是一种用于监测和审核交换机流量的技术手段,通过将特定端口的流量镜像到监控端口上,管理员可以实时监测和分析网络的流量情况,及时发现异常流量或攻击行为。
这对于保障网络的安全性和预防潜在的安全威胁非常重要。
浅谈交换机安全配置交换机是网络中的重要设备,它可以连接不同的网络设备,实现数据的交换和转发。
在网络中,交换机的安全配置是至关重要的,它可以帮助保护网络免受恶意攻击和非法访问。
本文将从几个方面浅谈交换机的安全配置,帮助读者了解如何有效地保护网络安全。
一、交换机的基本安全配置1. 设置管理口的访问限制交换机的管理口是进行配置和管理的入口,保护好管理口可以有效地防止未经授权的访问。
在交换机上可以设置访问控制列表(ACL)或者端口安全等功能,限制只有特定的设备或者特定的IP地址可以访问管理口。
2. 修改默认密码交换机出厂时通常都有默认的用户名和密码,这些默认密码很容易被攻击者破解。
第一步就是修改默认密码,使用强密码对交换机进行保护。
3. 配置SSH和TELNET在管理交换机时,最好使用加密的协议,如SSH(Secure Shell)和TELNET(Telnet Protocol)是明文传输密码,容易被截获,不安全。
通过配置SSH,可以确保管理交换机时的安全性。
4. 使用安全协议在交换机的配置中,可以启用相关的安全协议,如HTTPS、SNMPv3等,来保护数据的安全传输。
5. 关闭不必要的服务交换机可能内置了一些不必要的服务,这些服务可能存在安全隐患,容易被攻击者利用。
关闭这些不必要的服务可以降低被攻击的风险。
二、VLAN安全配置VLAN(Virtual Local Area Network)是虚拟局域网络,它可以划分网络,增加网络的安全性。
在交换机上配置VLAN时,需要注意以下几点:1. 使用VLAN划分网络将网络划分成不同的VLAN,可以减少网络的广播域,增加网络的安全性。
不同的部门或者用户可以被划分到不同的VLAN中,相互隔离,提高网络的安全性。
2. 禁止VLAN跨越交换机交换机上的VLAN可以设置成本地VLAN和远程VLAN,禁止VLAN跨越不同的交换机可以减少网络攻击的风险。
3. 使用VLAN访问控制可以在交换机上配置VLAN的访问控制列表,限制不同VLAN之间的通信,增加网络的安全性。
第八章实验讲义---交换机基本配置端口安全与STP第12章交换机基本配置交换机是局域网中最重要的设备,交换机是基于MAC来进行工作的。
和路由器类似,交换机也有IOS,IOS的基本使用方法是一样的。
本章将简单介绍交换的一些基本配置。
关于VLAN 和Trunk等将在后面章节介绍。
12.1 交换机简介交换机是第2层的设备,可以隔离冲突域。
交换机是基于收到的数据帧中的源MAC地址和目的MAC地址来进行工作的。
交换机的作用主要有两个:一个是维护CAM(Conetxt Address Memory)表,该表是计算机的MAC地址和交换端口的映射表;另一个是根据CAM来进行数据帧的转发。
交换对帧的处理有3种:交换机收到帧后,查询CAM表,如果能查询到目的计算机所在的端口,并且目的计算机所在的端口不是交换接收帧的源端口,交换机将把帧从这一端口转发出去(Forward);如果该计算机所在的端口和交换机接收帧的源端口是同一端口,交换机将过滤掉该帧(Filter);如果交换机不能查询到目的计算机所在的端口,交换机将把帧从源端口以外的其他所有端口上发送出去,这称为泛洪(Flood),当交换机接收到的帧是广播帧或多播帧,交换机也会泛洪帧。
12.2 实验0:交换机基本配置1.实验目的:通过本实验,可以掌握交换机的基本配置这项技能。
2.实验拓扑实验拓扑图如图12-2所示。
图12-2 实验1拓扑图3.实验步骤(1)步骤1:通过PC0以Console方式登录交换机Switch0. 注意配置PC0上的终端.登录成功后, 通过PC0配置交换机Switch0的主机名Switch>enableSwitch#conf terminalEnter configuration commands,one per line. End with CNTL/ZSwitch(config)#hostname S1(2)步骤2:配置telnet密码和enable密码. S1(config)#enable secret ciscoS1(config)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#login(3)步骤3:接口基本配置默认时,交换机的以太网接口是开启的,对于交换机的以太网口可以配置其双工模式和速率等。
交换机端口安全认证实验报告一、实验目的本实验旨在通过交换机端口安全认证,保障网络的信息安全。
通过实验,掌握交换机端口安全认证的原理和操作方法。
二、实验原理交换机端口安全认证是一种网络安全技术,用于限制未经授权设备接入网络。
其原理是利用交换机的MAC地址过滤功能,将非授权MAC地址的设备隔离或阻断,确保网络中只有授权设备能够接入。
三、实验环境1. 实验设备:一台交换机、若干台计算机设备2. 实验软件:网络配置工具、终端仿真软件四、实验步骤1. 配置交换机端口安全策略a. 进入交换机管理界面,并使用管理员账号登录。
b. 找到需要配置端口安全的端口,例如FastEthernet0/1。
c. 配置端口安全认证,设置允许连接设备的最大数量,例如2。
d. 配置端口安全认证方式为“限制”模式,即在达到最大设备数量时阻断后续设备连接。
e. 保存配置并退出管理界面。
2. 连接计算机设备a. 将一台计算机连接到已配置了端口安全的交换机端口上。
b. 打开终端仿真软件,配置计算机的IP地址和子网掩码。
c. 确保计算机与交换机端口连接正常。
3. 验证端口安全认证功能a. 将其他计算机设备依次连接到交换机端口。
b. 观察并记录交换机管理界面上的端口状态变化。
c. 当连入的设备数量达到最大允许数量时,验证交换机是否能够正确阻断后续设备连接。
五、实验结果与分析根据实验步骤进行操作后,我们观察到交换机管理界面上的端口状态发生了如下变化:1. 当第一台设备连接到交换机端口时,端口状态显示为“已连接”。
2. 当第二台设备连接到交换机端口时,端口状态仍显示为“已连接”,符合我们设定的最大允许设备数量为2。
3. 当第三台设备尝试连接到交换机端口时,端口状态显示为“已阻断”,交换机成功拦截了未授权设备连接。
通过以上观察,我们可以得出结论:交换机端口安全认证功能有效,能够根据设定的策略拦截未授权设备的连接,确保网络的安全性。
六、实验总结本次实验通过对交换机端口安全认证的配置和验证,详细了解了其原理和操作方法。
交换机端口安全性交换机端口安全性【实验名称】交换机端口安全性【实验目的】理解什么是交换机的端口安全性,如何配置端口安全性。
【背景描述】从网络管理的安全性考虑,某企业网络管理员想对交换机上端口的访问权限做些限制,通过限制允许访问交换机某个端口的MAC地址以及IP地址(可选)来实现严格控制对该端口的输入。
现在要通过在交换机上做适当配置来实现这一目标。
本实验以一台S2126G交换机为例,交换机名为SwitchA。
一台PC机通过串口(Com)连接到交换机的控制(Console)端口,通过网卡(NIC)连接到交换机的fastethernet 0/1端口。
假设该PC机的IP地址为192.168.0.137 ,网络掩码为255.255.255.0 ,MAC地址为00-E0-98-23-95-26,为了验证实验的效果,另准备一台PC机,其IP地址设为192.168.0.150 ,网络掩码为255.255.255.0 。
【实现功能】通过在交换机上设置端口安全性来实现对网络访问的控制。
【实验拓扑】F0/1ConsoleNIC ComPC【实验设备】S2126G(1台)【实验步骤】第一步:在交换机上配置管理接口IP地址SwitchA(config)# interface vlan 1 !进入交换机管理接口配置模式SwitchA(config-if)# ip address 192.168.0.138 255.255.255.0 !配置交换机管理接口IP地址SwitchA(config-if))# no shutdown !开启交换机管理接口验证测试:验证交换机管理IP地址已经配置和开启,PC机与交换机有网络连通性SwitchA#show ip interface !验证交换机管理IP地址已经配置,管理接口已开启Interface : VL1Description : Vlan 1OperStatus : upManagementStatus : EnabledPrimary Internet address: 192.168.0.138/24Broadcast address : 255.255.255.255PhysAddress : 00d0.f8ef.9d08SwitchA#ping 192.168.0.137 !验证交换机与PC机具有网络连通性Sending 5, 100-byte ICMP Echos to 192.168.0.137,timeout is 2000 milliseconds.Success rate is 100 percent (5/5)Minimum = 1ms Maximum = 3ms, Average = 1ms第二步:打开交换机上fastethernet 0/1接口的端口安全功能SwitchA(config)# interface fastethernet 0/1SwitchA(config-if)#switchport mode access !配置fastethernet 0/1接口为access 模式SwitchA(config-if)#switchport port-security !在fastethernet 0/1接口上打开端口安全功能验证测试:验证已开启fastethernet 0/1接口的端口安全功能SwitchA#show port-security interface fastethernet 0/1Interface : Fa0/1Port Security : EnabledPort status : upViolation mode : ProtectMaximum MAC Addresses : 128Total MAC Addresses : 0Configured MAC Addresses : 0Aging time : 0 minsSecure static address aging : Disabled第三步:配置安全端口上的安全地址(可选)SwitchA(config)# interface fastethernet 0/1SwitchA(config-if)# switchport port-security mac-address 00e0.9823.9526 ip-address 192.168.0.137! 手工配置接口上的安全地址验证测试:验证已配置了安全地址SwitchA#show port-security addresslan Mac Address IP Address Type Port Remaining Age(mins)---- --------------- --------------- ---------- -------- ------------------- 1 00e0.9823.9526 192.168.0.137 Configured Fa0/1第四步:验证这台PC机可以通过fastethernet 0/1端口访问交换机,而其它计算机不能通过fastethernet 0/1端口访问该交换机C:\>ping 192.168.0.138 ! 验证这台PC机可以通过fastethernet 0/1端口访问交换机现在拔下网线,将另一台计算机连接到交换机的fastethernet 0/1端口上C:\>ping 192.168.0.138 ! 验证这台PC机不能通过fastethernet 0/1端口访问交换机【注意事项】●安全地址设置是可选的;●如果交换机端口所连接的计算机网卡或IP地址发生改变,则必须在交换机上做相应的改变。
交换机的端⼝安全交换机最常⽤的对端⼝安全的理解就是可根据MAC地址来做对⽹络流量的控制和管理,⽐如MAC地址与具体的端⼝绑定,限制具体端⼝通过的MAC地址的数量,或者在具体的端⼝不允许某些MAC地址的帧流量通过。
稍微引申下端⼝安全,就是可以根据802.1X来控制⽹络的访问流量。
⼀、MAC地址与端⼝绑定和根据MAC地址允许流量的配置1.MAC地址与端⼝绑定当发现主机的MAC地址与交换机上指定的MAC地址不同时,交换机相应的端⼝将down 掉。
当给端⼝指定MAC地址时,端⼝模式必须为access或者Trunk状态。
1.3550-1#conf t2.3550-1(config)#int f0/13.3550-1(config-if)#switchport mode access /指定端⼝模式。
4.3550-1(config-if)#switchport port-security mac-address 00-90-F5-10-79-C1 /配置MAC地址。
5.3550-1(config-if)#switchport port-security maximum 1 /限制此端⼝允许通过的MAC地址数为1。
6.3550-1(config-if)#switchport port-security violation shutdown /当发现与上述配置不符时,端⼝down掉。
2.通过MAC地址来限制端⼝流量此配置允许⼀TRUNK⼝最多通过100个MAC地址,超过100时,但来⾃新的主机的数据帧将丢失。
1.3550-1#conf t2.3550-1(config)#int f0/13.3550-1(config-if)#switchport trunk encapsulation dot1q4.3550-1(config-if)#switchport mode trunk /配置端⼝模式为TRUNK。
5.3550-1(config-if)#switchport port-security maximum 100 /允许此端⼝通过的最⼤MAC地址数⽬为100。
交换机端口利用率的安全值
交换机端口利用率的正常范围在70%~80%,新建网络达到60%时,可以考虑使用更高级的设备或增加备份等。
如果端口利用率达到80%~90%,网络通常仍能正常运行,但长时间处于高负荷状态可能导致设备出现误码等问题,影响稳定性。
以上仅供参考,端口利用率的安全值会根据交换机的品牌和型号而有所差异。
因此,对于交换机的监控和安全值的设定,最好参照生产厂商的文档或者咨询专业技术人员的建议。
交换机端口利用率的安全值指的是在交换机端口正常工作时,其带宽的使用率应保持在一定的范围内,以确保网络正常运行和避免潜在的风险。
一般来说,交换机端口利用率的正常范围在70%~80%,如果超出这个范围,可能会导致网络性能下降或出现其他问题。
如果交换机端口利用率过高,可能会导致网络拥堵和数据传输延迟,甚至可能出现丢包现象。
这不仅会影响用户的网络体验,还可能对网络设备的正常运行造成影响。
因此,需要监控交换机端口的利用率,并采取相应的措施来确保网络的稳定性和可靠性。
为了确保交换机端口利用率的安全,可以采取以下措施:
1.合理规划网络结构,避免网络瓶颈的出现。
2.合理配置交换机端口的速度和双工模式,以匹配网络的实际需求。
3.定期检查网络设备的性能指标,及时发现和解决潜在的问题。
4.实施流量控制和限速等策略,避免网络拥堵和异常流量的产生。
5.备份关键网络设备,确保在设备故障时可以快速恢复网络的正常运行。
总之,合理规划和配置交换机端口,以及采取相应的措施来监控和管理网络设备的性能指标,是确保网络稳定性和可靠性的关键。
华为交换机端⼝安全怎么配置?华为交换机端⼝安全命令
的⽤法
在华为交换机配置中,经常遇到各种问题,那么如何配置端⼝安全?下⾯就为⼤家带来详细的配置过程,详细请看下⽂介绍。
1、登录华为交换机,进⼊系统视图模式。
2、进⼊华为交换机接⼝视图。
3、在接⼝视图下开启端⼝安全功能。
命令:port-security enable
4、开启端⼝安全之后,使能接⼝Sticky MAC功能。
5、配置端⼝功能的保护动作。
命令:port-security protect-action protect
6、在接⼝下配置MAC地址学习限制数,设置⼀个表⽰只允许⼀台主机接⼊。
命令:port-security max-mac-num 1
以上就是华为交换机端⼝安全命令的⽤法,希望⼤家喜欢,请继续关注。
配置交换机端⼝安全-静态MAC地址绑定要求:1. 配置SW1上的e0/0这个接⼝,只允许MAC地址为11.1111的设备连接预配置:SW1:enconf thostname SW1int e0/0sw mo acsw ac vlan 1switchport port-securityswitchport port-security maximum 1switchport port-security mac-address 11.1111Exit配置结束后,在SW1上使⽤show port-security查看接⼝的安全配置sw1#show port-securitySecure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action(Count) (Count) (Count)---------------------------------------------------------------------------Et0/0 1 1 55 Shutdown---------------------------------------------------------------------------Total Addresses in System (excluding one mac per port) : 0Max Addresses limit in System (excluding one mac per port) : 4096sw1#使⽤show port-security int e0/0查看接⼝安全信息配置SW1#show port-security int e0/0Port Security : EnabledPort Status : Secure-upViolation Mode : ShutdownAging Time : 0 minsAging Type : AbsoluteSecureStatic Address Aging : DisabledMaximum MAC Addresses : 1Total MAC Addresses : 1Configured MAC Addresses : 1Sticky MAC Addresses : 0Last Source Address:Vlan : 0000.0000.0000:0Security Violation Count : 0使⽤show port-security address能看到什么?sw1#show port-security addressSecure Mac Address Table-----------------------------------------------------------------------------Vlan Mac Address Type Ports Remaining Age (mins)---- ----------- ---- ----- -------------1 11.1111 SecureConfigured Et0/0 ------------------------------------------------------------------------------Total Addresses in System (excluding one mac per port) : 0Max Addresses limit in System (excluding one mac per port) : 4096在SW1上打开debug port-security现在配置R1的e0/0接⼝,R2的e0/0接⼝:R1:enconf thostname R1int e0/0ip add 192.168.0.1 255.255.255.0no shExitR2:enconf thostname R2int e0/0ip add 192.168.0.2 255.255.255.0no shExit现在SW1上debug会显⽰什么信息?sw1#debug port-securityAll Port Security debugging is onsw1#*Jan 23 09:43:56.004: PSECURE: unix_psecure_input: swidb = Ethernet0/0 mac_addr = 00.0200 vlanid = 1*J a n 23 09:43:56.004: PSECURE: Violation/duplicate detected u p o n receiving 00.0200 o n v l a n 1: port_num_addrs 1 port_max_addrs 1 vlan_addr_ct 1: vlan_addr_max 1 total_addrs 0: max_total_addrs 4096*Jan 23 09:43:56.004: PSECURE: psecure_add_addr_check: Security violation occurred, bring down the interface*Jan 23 09:43:56.004: %PM-4-ERR_DISABLE: psecure-violation error detected on Et0/0, putting Et0/0 in err-disable state*Jan 23 09:43:56.004: PSECURE: psecure_vp_fwdchange invoked*Jan 23 09:43:56.004: PSECURE: psecure_vp_linkdown port Et0/0, vlan 1, oper mode access, sb mode access*Jan 23 09:43:56.004: PSECURE: Clearing HA table for 1*Jan 23 09:43:56.004: PSECURE: psecure_clear_ha_table: called*Jan 23 09:43:56.004: PSECURE: psecure_clear_ha_table: delete 11.1111 vlan 1*Jan 23 09:43:56.004: PSECURE:psecure_platform_del_mac_addrs: unimplemented function!*Jan 23 09:43:56.004: PSECURE: psecure_linkchange: Et0/0 hwidb=0xACD8C2E0*Jan 23 09:43:56.004: PSECURE: Link is going down*Jan 23 09:43:56.004: PSECURE: psecure_linkdown_init: Et0/0 hwidb = 0xACD8C2E0*Jan 23 09:43:56.004: PSECURE: psecure_deactivate_port_security: Deactivating port-security feature*Jan 23 09:43:56.004: PSECURE: port_deactivate: port status is 0*Jan 23 09:43:56.004: PSECURE: psecure_clear_ha_table: called*J a n 2 3 09:43:56.004: %PORT_SECURITY-2-PSECURE_VIOLATION: Se cu r ity violation occurred, c a u s e d b y M A C address 00.0200 on port Ethernet0/0.sw1#*Jan 23 09:43:56.004: PSECURE: Security violation, TrapCount:1*Jan 23 09:43:57.009: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to downsw1#*Jan 23 09:43:58.004: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to downsw1#现在SW1上使⽤show int e0/0,这个接⼝是什么状态?sw1#show int e0/0Ethernet0/0 is down, line protocol is down (err-disabled)Hardware is AmdP2, address is 00.0100 (bia 00.0100)MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation ARPA, loopback not setKeepalive set (10 sec)Auto-duplex, Auto-speed, media type is unknowninput flow-control is off, output flow-control is unsupportedARP type: ARPA, ARP Timeout 04:00:00Last input 00:00:03, output 00:03:47, output hang neverLast clearing of "show interface" counters neverInput queue: 0/2000/0/0 (size/max/drops/flushes); Total output drops: 0Queueing strategy: fifoOutput queue: 0/0 (size/max)5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec60 packets input, 10766 bytes, 0 no bufferReceived 36 broadcasts (0 multicasts)0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored0 input packets with dribble condition detected259 packets output, 19906 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 unknown protocol drops0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers swapped outsw1#现在R1把MAC地址修改成11.1111能接⼊到交换机上吗?(把SW1的e0/0恢复)Conf tint e0/0mac-address 11.1111现在R1能Ping通R2吗?sw1(config)#int e0/0sw1(config-if)#shsw1(config-if)#no shsw1(config-if)#sw1#show ip int bInterface IP-Address OK? Method Status ProtocolEthernet0/0 unassigned YES unset up upEthernet0/1 unassigned YES unset up upEthernet0/2 unassigned YES unset up upEthernet0/3 unassigned YES unset up upEthernet1/0 unassigned YES unset up up Ethernet1/1 unassigned YES unset up up Ethernet1/2 unassigned YES unset up up Ethernet1/3 unassigned YES unset up up Serial2/0 unassigned YES unset administratively down down Serial2/1 unassigned YES unset administratively down down Serial2/2 unassigned YES unset administratively down down Serial2/3 unassigned YES unset administratively down down Serial3/0 unassigned YES unset administratively down down Serial3/1 unassigned YES unset administratively down down Serial3/2 unassigned YES unset administratively down down Serial3/3 unassigned YES unset administratively down down sw1#^ZR1#ping 192.168.0.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 msR1#。
实验环境搭建:
1. 准备两台计算机,一台作为服务器,另一台作为客户端。
2. 在服务器上安装操作系统(如Windows Server 2016或Linux)。
3. 在客户端上安装操作系统(如Windows 10或Linux)。
4. 在服务器和客户端之间建立网络连接,可以使用网线或无线网络。
5. 配置IP地址、子网掩码、网关等网络参数,确保两台计算机可以互相访问。
交换机端口安全配置:
1. 登录交换机管理界面,进入端口安全配置页面。
2. 选择需要配置的端口,设置安全模式(如静态安全、动态安全等)。
3. 设置最大连接数,限制同一端口上的设备数量。
4. 启用MAC地址过滤,只允许指定的MAC地址通过该端口。
5. 设置端口速率限制,防止恶意设备占用大量带宽。
6. 启用802.1X认证,要求用户输入用户名和密码才能访问网络。
7. 保存配置并重启交换机,使配置生效。
H3C端口绑定与端口安全端口安全:1.启用端口安全功能[H3C]port-security enable2.配置端口允许接入的最大MAC地址数[H3C-Ethernet1/0/3]port-security max-mac-count count-value缺省情况下,最大数不受限制为03.配置端口安全模式[H3C-Ethernet1/0/3]port-security port-mode { autolearn |noRestriction… }4.手动添加Secure MAC地址表项[H3C-Ethernet1/0/3] mac-address security mac-address vlan vlan-id5.配置Intrusion Protection(Intrusion Protection被触发后,设置交换机采取的动作)[H3C-Ethernet1/0/3]port-security intrusion-mode { blockmac | disableport | disableport -temporarily }验证命令:display port-security [ interface interface-list ] 显示端口安全配置的相关信息display mac-address security [ interface interface-type interface-number ] [ vlan vlan-id ]显示Secure MAC地址的配置信息端口+IP+MAC绑定方法一:[H3C]am user-bind mac-addr B888-E37B-CE2C ip-addr 192.168.1.106 interface Ethernet 1/0/3方法二:[H3C-Ethernet1/0/3] am user-bind mac-addr B888-E37B-CE2C ip-addr 192.168.1.106验证命令:[H3C]display am user-bind 显示端口绑定的配置信息端口+IP绑定[H3C-Ethernet1/0/3] am user-bind ip-addr 192.168.1.106注:交换机只要接收一个3层表项,交换机使用动态ARP产生一条arp条目。
【实验文档】【实验0021】【交换机的端口安全配置】【实验名称】交换机的端口安全配置。
【实验目的】掌握交换机的端口安全功能,控制用户的安全接入。
【背景描述】你是一个公司的网络管理员,公司要求对网络进行严格控制。
为了防止公司内部用户的IP 地址冲突,防止公司内部的网络攻击和破坏行为。
为每一位员工分配了固定的IP地址,并且限制只允许公司员工主机可以使用网络,不得随意连接其他主机。
例如:某员工分配的IP地址是172.16.1.55/24,主机MAC地址是00-06-1B-DE-13-B4。
该主机连接在1台2126G 上边。
【技术原理】交换机端口安全功能,是指针对交换机的端口进行安全属性的配置,从而控制用户的安全接入。
交换机端口安全主要有两种类项:一是限制交换机端口的最大连接数,二是针对交换机端口进行MAC地址、IP地址的绑定。
限制交换机端口的最大连接数可以控制交换机端口下连的主机数,并防止用户进行恶意的ARP欺骗。
交换机端口的地址绑定,可以针对IP地址、MAC地址、IP+MAC进行灵活的绑定。
可以实现对用户进行严格的控制。
保证用户的安全接入和防止常见的内网的网络攻击。
如ARP欺骗、IP、MAC地址欺骗,IP地址攻击等。
配置了交换机的端口安全功能后,当实际应用超出配置的要求,将产生一个安全违例,产生安全违例的处理方式有3种:⌝ protect 当安全地址个数满后,安全端口将丢弃未知名地址(不是该端口的安全地址中的任何一个)的包。
⌝ restrict 当违例产生时,将发送一个Trap通知。
⌝ shutdown 当违例产生时,将关闭端口并发送一个Trap通知。
当端口因为违例而被关闭后,在全局配置模式下使用命令errdisable recovery来将接口从错误状态中恢复过来。
【实现功能】针对交换机的所有端口,配置最大连接数为1,针对PC1主机的接口进行IP+MAC地址绑定。
【实验设备】S2126G交换机(1台),PC(1台)、直连网线(1条)【实验拓扑】图 26【实验步骤】步骤1. 配置交换机端口的最大连接数限制。
Switch#configure terminalSwitch(config)#interface range fastethernet 0/1-23 ! 进行一组端口的配置模式Switch(config-if-range)#switchport port-security!开启交换机的端口安全功能Switch(config-if-range)#switchport port-secruity maximum 1! 配置端口的最大连接数为1Switch(config-if-range)#switchport port-secruity violation shutdown !配置安全违例的处理方式为shutdown验证测试:查看交换机的端口安全配置。
Switch#show port-securitySecure Port MaxSecureAddr(count) CurrentAddr(count) Security Action------------------------------------------------------------------Fa0/1 1 0ShutdownFa0/2 1 0ShutdownFa0/3 1 0ShutdownFa0/4 1 0ShutdownFa0/5 1 0ShutdownFa0/6 1 0 ShutdownFa0/7 1 0 ShutdownFa0/8 1 0 ShutdownFa0/9 1 0 ShutdownFa0/10 1 0 ShutdownFa0/11 1 0 ShutdownFa0/12 1 0 ShutdownFa0/13 1 0 ShutdownFa0/14 1 0 ShutdownFa0/15 1 0 ShutdownFa0/16 1 0 ShutdownFa0/17 1 0 ShutdownFa0/18 1 0 ShutdownFa0/19 1 0 ShutdownFa0/20 1 0 ShutdownFa0/21 1 0 ShutdownFa0/22 1 0 ShutdownFa0/23 1 0 Shutdown步骤2. 配置交换机端口的地址绑定。
P查看主机的IP和MAC地址信息在主机上打开CMD命令提示符窗口,执行ipconfig /all命令。
图 27P配置交换机端口的地址绑定Switch#configure terminalSwitch(config)#interface fastethernet 0/3Switch(config-if)#switchport port-securitySwitch(config-if)#switchport port-security mac-address0006.1bde.13b4 ip-address 172.16.1.55 !配置IP地址和MAC地址的绑定验证测试:查看地址安全绑定配置。
Switch#show port-security addressVlan Mac Address IP Address Type Port Remaining Age(mins)--------------------------------------------------------------------1 0006.1bde.13b4 172.16.1.55 Configured Fa0/3【注意事项】1、交换机端口安全功能只能在ACCESS接口进行配置。
2、交换机最大连接数限制取值范围是1~128,默认是128。
3、交换机最大连接数限制默认的处理方式是protect。
【参考配置】Switch#show running-configSystem software version : 1.61(4) Build Sep 9 2005 ReleaseBuilding configuration...Current configuration : 3556 bytes!version 1.0!hostname Switchvlan 1!interface fastEthernet 0/1switchport port-securityswitchport port-security violation shutdownswitchport port-security maximum 1!interface fastEthernet 0/2switchport port-securityswitchport port-security violation shutdownswitchport port-security maximum 1!interface fastEthernet 0/3switchport port-securityswitchport port-security violation shutdownswitchport port-security maximum 1switchport port-security mac-address 0006.1bde.13b4 ip-address 172.16.1.55 !interface fastEthernet 0/4switchport port-securityswitchport port-security violation shutdownswitchport port-security maximum 1!interface fastEthernet 0/5switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/6switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/7switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/8switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/9switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/10switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/11switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/12switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/13switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/14switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/15switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/16switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/17switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/18switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/19switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/20switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/21switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/22switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!interface fastEthernet 0/23switchport port-securityswitchport port-security violation shutdown switchport port-security maximum 1!end。