• 华为交换机:ARP静态绑定技术


    ARP的查看

    下面这个命令是查看所有网段的ARP

    dis arp
    
    • 1

    在这里插入图片描述
    注意:这个命令显示出来信息,有可能是无效的、过期的。
    举个例子:明明这个IP地址是可以ping通的,但是ARP列表找不到。
    这个时候我们就需要扫描MAC。

    arp scan 扫描MAC码

    使用的是arp scan这个命令扫描MAC码 ,这个命令只能在接口模式下才能使用。

    [HEXIN-SWH-Vlanif10]arp scan    
    Warning: This operation may take a long time, press CTRL+C to break. Continue?[Y/N]:y
    Processing...............
    Info: ARP scanning is completed.
    
    • 1
    • 2
    • 3
    • 4

    建议选择接口的时候选择三层接口。

    arp fixup 快速绑定

    使用arp fixup命令,可以快速静态绑定。

    [HEXIN-SWH-Vlanif10]arp fixup   #快速绑定VLAN10下所有MAC和IP
    Warning: This operation may generate configuration of static ARP, and take a long time, press CTRL+C to break. Continue?[Y/N]:y
    Processing...
    Info: ARP fixup is completed.
    
    • 1
    • 2
    • 3
    • 4

    注意事项:

    • 先arp扫描得到有效的arp信息,再进行一键ARP静态绑定;
    • 快速绑定相关命令仅本次操作生效,后续新接入网络的主机,可再次使用命令进行绑定即可。

    单个主机的绑定

    静态绑定单个主机

     arp static 192.168.100.2 704d-7bb2-de0b
    
    • 1

    注意:一个主机MAC可静态绑定多个IP

    ARP静态绑定,绑定指定的物理接口

    arp static 192.168.100.1 704d-7bb2-de0b 110 GigabitEthernet1/0/18
    
    • 1

    删除ARP静态绑定信息:

    undo arp 192.168.1.2
    
    • 1

    绑定后如图:
    在这里插入图片描述

    查询单个IP或者MAC

    [HEXIN-SWH]disp arp | in 10.5.1.135                                                                   
    IP ADDRESS      MAC ADDRESS     EXPIRE(M) TYPE INTERFACE      VPN-INSTANCE      
                                              VLAN 
    ------------------------------------------------------------------------------
    10.5.1.135      00e0-4c49-c123            S--  GE0/0/17
    ------------------------------------------------------------------------------
    Total:109       Dynamic:99      Static:1     Interface:9    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    IP和MAC绑定错误会导致什么?

    IP和MAC绑定错误,会导致无法通信。所以绑定之前需要慎重。

    基于接口的DHCP静态IP的管理

    DHCP绑定静态IP

     dhcp server static-bind ip-address 10.5.1.131 mac-address 408d-d5cf-2972 description xingzhengdayin
     dhcp server static-bind ip-address 10.5.1.181 mac-address 24be-e05e-f4c4 description gongchengdayin
     dhcp server static-bind ip-address 10.5.1.183 mac-address 40b0-0342-cda8 description shichangdayin
    
    • 1
    • 2
    • 3

    绑定时可能会出现下面错误提示:

    Error:The static-MAC is exist in this IP-pool.
    Error:The IP address is being used by a static-MAC user.
    
    解决方法:
    
    reset ip pool name pool-1f 10.1.1.5   #释放已分配出去的ip地址
    reset ip pool name vlan10 all/userd   #释放基于接口配置dhcp中所有或者已使用的
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    查询VLAN10接口所有IP地址分配情况

    <HEXIN-SWH>display ip pool interface Vlanif10 used 
      Pool-name        : Vlanif10
      Pool-No          : 0
      Lease            : 2 Days 0 Hours 0 Minutes
      Domain-name      : -
      DNS-server0      : 10.5.6.2        
      DNS-server1      : 114.114.114.114 
      NBNS-server0     : -               
      Netbios-type     : -               
      Position         : Interface       
      Status           : Unlocked
      Gateway-0        : -               
      Network          : 10.5.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Logging          : Disable
      Conflicted address recycle interval: -
      Address Statistic: Total       :254       Used        :58         
                         Idle        :36        Expired     :35         
                         Conflict    :5         Disabled    :155    
    
     -------------------------------------------------------------------------------------
      Network section 
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------------
            10.5.1.1      10.5.1.254     254      58        36(35)       5   155
     -------------------------------------------------------------------------------------
     Client-ID format as follows:            
       DHCP  : mac-address                 PPPoE   : mac-address            
       IPSec : user-id/portnumber/vrf      PPP     : interface index            
       L2TP  : cpu-slot/session-id         SSL-VPN : user-id/session-id
     -------------------------------------------------------------------------------------
      Index              IP             Client-ID    Type       Left   Status           
     -------------------------------------------------------------------------------------
        101      10.5.1.102        bca9-2063-ea15    DHCP      61765   Used             
        102      10.5.1.103        00e0-4c21-51e2    DHCP     146200   Used             
        103      10.5.1.104        7845-c41d-127b    DHCP     145252   Used             
        104      10.5.1.105        446e-e542-0c88    DHCP     153660   Used                       
        122      10.5.1.123        1866-da22-191a    DHCP     104893   Used             
        123      10.5.1.124        4ccc-6a3e-97a0    DHCP     147836   Used             
        125      10.5.1.126        e631-b0a1-facd    DHCP     157211   Used             
        128      10.5.1.129        dc9c-521d-3173    DHCP     147825   Used             
        129      10.5.1.130        a048-1cc0-c22a    DHCP     109495   Used             
        130      10.5.1.131        408d-d5cf-2972    DHCP          -   Static-bind      
        132      10.5.1.133        408d-5c74-6a36    DHCP     147769   Used             
        133      10.5.1.134        9890-96c8-4191    DHCP     147590   Used                       
        151      10.5.1.152        1c1b-0d33-6464    DHCP     163881   Used             
        154      10.5.1.155        9890-96ae-a7d1    DHCP     104884   Used             
        155      10.5.1.156        00e0-4c49-c535    DHCP     147085   Used             
        156      10.5.1.157        7845-c41d-13e8    DHCP     149054   Used             
        157      10.5.1.158        a2d7-0cae-9a12    DHCP     171661   Used             
    ...        
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
  • 相关阅读:
    Linux学习第18天:Linux并发与竞争: 没有规矩不成方圆
    CodeTON Round 6 (Div 1 + Div 2, Rated, Prizes!)(A - E)
    Promise.all和 race
    nfs实现共享目录对于集群高可用风险,nfs客户端容易卡死
    React SSR - 写个 Demo 一学就会
    Redis八股文(大厂面试真题)
    《公共政策学》重点整理
    Linux,计算机网络,数据库
    使用Docker部署Python Flask应用的完整教程
    【网络奇缘】- 计算机网络|网络类型|性能指标
  • 原文地址:https://blog.csdn.net/annita2019/article/details/126347820