赞
踩
下面这个命令是查看所有网段的ARP
dis arp
注意:这个命令显示出来信息,有可能是无效的、过期的。
举个例子:明明这个IP地址是可以ping通的,但是ARP列表找不到。
这个时候我们就需要扫描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.
建议选择接口的时候选择三层接口。
使用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.
reset arp static #清除静态arp
注意事项:
arp static 192.168.100.2 704d-7bb2-de0b
注意:一个主机MAC可静态绑定多个IP
arp static 192.168.100.1 704d-7bb2-de0b 110 GigabitEthernet1/0/18
undo arp 192.168.1.2
绑定后如图:
[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
ARP静态绑定往往是和DHCP配合使用,必须先利用DHCP把IP和MAC配置成静态,再进行ARP得绑定。
换句说法就是DHCP中IP对应得MAC,要和ARP中IP对应得MAC相同。
两者必须一致:
DHCP静态: 192.168.10.125 xxxx-xxxx-x001
ARP静态: 192.168.10.125 xxxx-xxxx-x001
IP和MAC绑定错误,会导致无法通信。所以绑定之前需要慎重。例如下面这个:
DHCP静态: 192.168.10.125 xxxx-xxxx-x001
ARP静态: 192.168.10.125 xxxx-xxxx-x002
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
绑定时可能会出现下面错误提示:
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 interface Vlanif10 10.5.1.108 #释放已分配出去的ip地址
reset ip pool interface Vlanif10 all #释放基于接口配置dhcp中所有或者已使用的
查询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
但是显示中往往会出现一些让人意想不到得问题,我绑定得时候,提示我MAC错误。查了很多资料说是华为得bug,需要打补丁,但是打补丁得这种事情风险太大了,于是我就放弃了。但是问题总是要解决得。于是我就想到了用Windwos搭建DHCP服务器,然后做中继。因为用路由器得话,感觉MAC多了也不好管理。至于DHCP中继,就不再啰嗦了。这个实验还做得少啊?我下面这篇文章中有成品,大家直接用吧!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。