华为交换机MAC找端口、限速和禁端口命令

本文详细介绍了如何在华为交换机上通过MAC地址查找对应端口,进行端口限速配置,包括上传和下载速度限制的具体命令。同时,提供了关闭和开启端口的方法及查看端口状态的命令。

进入交换机后:

 

 

  1. 通过已知的MAC来回去改MAC的端口

 

<HUAWEI>dis mac-address

-------------------------------------------------------------------------------

MAC Address    VLAN/VSI                          Learned-From        Type      

-------------------------------------------------------------------------------

0026-b92c-79a7 1/-                               GE0/0/14            dynamic   

0026-b95a-cc35 1/-                               GE0/0/18            dynamic   

3c97-0e6a-d49c 1/-                               GE0/0/24            dynamic   

d4ae-52cd-f19d 1/-                               GE0/0/22            dynamic   

e0db-5525-fa15 1/-                               GE0/0/2             dynamic   

 

-------------------------------------------------------------------------------

Total items displayed = 5

 

 

  1. 通过匹配端口来限速(那匹配的 0/0/18 端口为例)

a.<HUAWEI>system-view        //进视图模式        

b.[HUAWEI]interface GigabitEthernet 0/0/18      //   interface GigabitEthernet 0/0/18才是命令

c.[HUAWEI-GigabitEthernet0/0/18]qos lr inbound cir 10240 cbs 204800    //上传限速10M    cbs官方建议=200 * cir

d.[HUAWEI-GigabitEthernet0/0/18]qos lr outbound cir 20480 cbs 409600   //下载限速20M    20480kbp=20Mbp

e.[HUAWEI-GigabitEthernet0/0/18]display this       //查看有哪些部署18端口

#

interface GigabitEthernet0/0/18

 qos lr outbound cir 20480 cbs 409600

 qos lr inbound cir 10240 cbs 204800

#

return

 

f.[HUAWEI-GigabitEthernet0/0/18]undo qos lr inbound   //删除18端口上传限速

g.[HUAWEI-GigabitEthernet0/0/18]undo qos lr outbound  //删除18端口下载限速

备注:查看所有端口配置,可以使用命令display current-configuration interface

 

  1. 关闭端口和开启(以18端口为例)

a.<HUAWEI>system-view

b.[HUAWEI]interface GigabitEthernet 0/0/18

c.[HUAWEI-GigabitEthernet0/0/18]shutdown          //关闭端口

d.[HUAWEI-GigabitEthernet0/0/18]display interface brief     //显示所有端口状态简报

PHY: Physical

*down: administratively down

#down: LBDT down

(l): loopback

(s): spoofing

(b): BFD down

(e): ETHOAM down

(dl): DLDP down

(lb): LBDT block

InUti/OutUti: input utility/output utility

Interface                   PHY   Protocol  InUti OutUti   inErrors  outErrors

GigabitEthernet0/0/1        down  down         0%     0%          0          0

GigabitEthernet0/0/2        up    up           0%     0%          1          0

GigabitEthernet0/0/3        down  down         0%     0%          0          0

GigabitEthernet0/0/4        down  down         0%     0%          0          0

GigabitEthernet0/0/5        down  down         0%     0%          0          0

GigabitEthernet0/0/6        down  down         0%     0%          0          0

GigabitEthernet0/0/7        down  down         0%     0%          0          0

GigabitEthernet0/0/8        down  down         0%     0%          0          0

GigabitEthernet0/0/9        down  down         0%     0%          0          0

GigabitEthernet0/0/10       down  down         0%     0%          0          0

GigabitEthernet0/0/11       down  down         0%     0%          0          0

GigabitEthernet0/0/12       down  down         0%     0%          0          0

GigabitEthernet0/0/13       down  down         0%     0%          0          0

GigabitEthernet0/0/14       up    up           0%     0%          0          0

GigabitEthernet0/0/15       down  down         0%     0%          0          0

GigabitEthernet0/0/16       down  down         0%     0%          0          0

GigabitEthernet0/0/17       down  down         0%     0%          0          0

GigabitEthernet0/0/18       *down down         0%     0%          0          0

GigabitEthernet0/0/19       down  down         0%     0%          0          0

GigabitEthernet0/0/20       down  down         0%     0%          0          0

GigabitEthernet0/0/21       down  down         0%     0%          0          0

GigabitEthernet0/0/22       up    up           0%     0%          0          0

GigabitEthernet0/0/23       down  down         0%     0%          0          0

GigabitEthernet0/0/24       up    up           0%     0%          0          0

GigabitEthernet0/0/25       down  down         0%     0%          0          0

GigabitEthernet0/0/26       down  down         0%     0%          0          0

GigabitEthernet0/0/27       down  down         0%     0%          0          0

GigabitEthernet0/0/28       down  down         0%     0%          0          0

NULL0                       up    up(s)        0%     0%          0          0

Vlanif1

 

 

 

 

e.[HUAWEI-GigabitEthernet0/0/18]undo shutdown  

//开启端口  当你在这个路径下GigabitEthernet0/0/18 可以执行上面命令,否则:和关闭执行顺序一样

f.[HUAWEI-GigabitEthernet0/0/18]display interface brief   //这个命令不需要在0/0/18路径下

也是可以[HUAWEI]display interface brief

PHY: Physical

*down: administratively down

#down: LBDT down

(l): loopback

(s): spoofing

(b): BFD down

(e): ETHOAM down

(dl): DLDP down

(lb): LBDT block

InUti/OutUti: input utility/output utility

Interface                   PHY   Protocol  InUti OutUti   inErrors  outErrors

GigabitEthernet0/0/1        down  down         0%     0%          0          0

GigabitEthernet0/0/2        up    up           0%     0%          1          0

GigabitEthernet0/0/3        down  down         0%     0%          0          0

GigabitEthernet0/0/4        down  down         0%     0%          0          0

GigabitEthernet0/0/5        down  down         0%     0%          0          0

GigabitEthernet0/0/6        down  down         0%     0%          0          0

GigabitEthernet0/0/7        down  down         0%     0%          0          0

GigabitEthernet0/0/8        down  down         0%     0%          0          0

GigabitEthernet0/0/9        down  down         0%     0%          0          0

GigabitEthernet0/0/10       down  down         0%     0%          0          0

GigabitEthernet0/0/11       down  down         0%     0%          0          0

GigabitEthernet0/0/12       down  down         0%     0%          0          0

GigabitEthernet0/0/13       down  down         0%     0%          0          0

GigabitEthernet0/0/14       up    up           0%     0%          0          0

GigabitEthernet0/0/15       down  down         0%     0%          0          0

GigabitEthernet0/0/16       down  down         0%     0%          0          0

GigabitEthernet0/0/17       down  down         0%     0%          0          0

GigabitEthernet0/0/18       down  down         0%     0%          0          0

GigabitEthernet0/0/19       down  down         0%     0%          0          0

GigabitEthernet0/0/20       down  down         0%     0%          0          0

GigabitEthernet0/0/21       down  down         0%     0%          0          0

GigabitEthernet0/0/22       up    up           0%     0%          0          0

GigabitEthernet0/0/23       down  down         0%     0%          0          0

GigabitEthernet0/0/24       up    up           0%     0%          0          0

GigabitEthernet0/0/25       down  down         0%     0%          0          0

GigabitEthernet0/0/26       down  down         0%     0%          0          0

GigabitEthernet0/0/27       down  down         0%     0%          0          0

GigabitEthernet0/0/28       down  down         0%     0%          0          0

NULL0                       up    up(s)        0%     0%          0          0

Vlanif1                     up    up           --     --          0          0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值