交换机基础命令

椰子ya 网络安全 2020-08-05
查看序列号   dis dev man
查看邻居   display lldp neighbor-information
查看邻居(列表)  display lldp neighbor-information   list 
查看邻居(具体接口)   display lldp neighbor-information int ge1/0/11 ve(h3c)   
查看已运行配置   dis curr  
全局开启   lldp global en
查看聚合接口 dis int Bridge-Aggregation
dis arp | include (ip)  通过IP查mac
dis arp | include (mac)  通过mac查ip
dis mac-add | include (mac)  通过mac查找此终端在交换机的接口
dis cur 查看所有配置
dis logbuffer   查看插拔日志
dis arp | include   分IP查重
dis lldp ne interface (gi1/0/8) br  查看邻居
dis mac-add interface (gi1/0/8)   查看接口下mac地址
dis cur interface (gi1/0/8 )  查看接口配置      
dis lldp ne interface (GE2/2/0/3) ver     查看下联交换机                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
undo mac-address mac-learning enable     进接口关闭接口mac学习
mac-address static (fefe-18bb-379f) vlan 14  进接口 指定静态mac地址
interface Bridge-Aggregation(***)建立/进入聚合接口
description To (***)备注名称
【链路聚合配置
interface Bridge-Aggregation(101)
interface (g1/0/9)
port link-aggregation group (101)
interface (g2/0/9)
port link-aggregation group (101)
interface Bridge-Aggregation (101)
 port link-type trunk
 port trunk permit vlan (  1 51 to 52 )
 link-aggregation mode dynamic(默认方式)
cisco
show cdp ne dr  查看邻居详情
show mac add add  通过mac查找此终端在交换机的接口
show arp | include (ip)  通过IP查mac
show arp | include (mac)  通过mac查ip
show mac add interface (端口)  查看端口下的所有mac地址
show run   查看所有配置
show logging 查看插拔日志
show arp | include   分IP查重
show cdp ne gi。。。 de   看端口
设置trunk口
【interface( 0/1)    配置端口1为trunk口    
switchport mode trunk  配置trunk口允许通过的Vlan
switchport trunk allow vlan all   允许所有VLAN通过
exit  退出】
switchport port-security maximum 2 修改端口绑定地址2个
switchport port-security mac-address xxxx.xxxx.xxxx 添加需要绑定的mac地址
switchport port-security violation restrict 安全冲突限制模式
switchport port-security 打开potr-security功能
开多端口认证   进入已开认证端口
【authentication host-mode multi-host
   authentication port-control auto】
show arp | include 10.....-show mac add add ....-show cdp ne gi1/0...... de
IP-mac-接口-邻居-登陆新IP show mac add add 


中兴交换机去认证
mac查端口 进管理员 show mac  地址
端口查邻居  show zdp nei gig
conf t       nas        aaa (7 )control dot1x dis
cisco交换机去认证
 no authentication port-control auto(先进端口int gi1/0...)
cont f
int fastEthernet 0/18
shutdown 
no shutdown 关闭端口,启用端口
show int port-channel Po数
NEXT
实验:计划任务cron 定期备份