公司大约100台电脑每天早上上班都有电脑连接不上网 获取不到ip,固定个ip就好了;如何在路由器中配置ARP自动固化?
(0)
最佳答案
1、PC1只能使用10.0.0.1进行上网,其他终端不可以使用该IP上网。
2、只允许静态ARP绑定的终端能够上网,未绑定的终端不可以上网。比如PC1静态ARP绑定后可以上网,PC2未绑定不可以上网。
1、静态ARP绑定:
[MSR]arp static 10.0.0.1 74e4-011f-0306
其中查看ip对应mac地址,可通过:
[MSR]display arp interface GigabitEthernet 0/0
Type: S-Static D-Dynamic O-Openflow R-Rule M-Multiport I-Invalid
IP address MAC address SVLAN/VSI Interface/Link ID Aging Type
10.0.0.1 74e4-011f-0306 -- GE0/0 -- S
10.0.0.2 74e4-0ddc-0406 -- GE0/0 13 D
测试:
将PC2的ip地址改为10.0.0.1后做ping测试:
<PC2>ping 10.0.0.3
Ping 10.0.0.3 (10.0.0.3): 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping statistics for 10.0.0.3 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
<H3C>%Dec 20 19:25:24:217 2017 H3C PING/6/PING_STATISTICS: Ping statistics for 10.0.0.3: 5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss.
2、只允许静态ARP绑定的终端能够上网,未绑定的终端不可以上网:
在路由器接口下将max-learning-num设置为0,路由器在该接口下将无法动态学习终端的MAC地址,使得PC2无法正常上网。
[MSR-GigabitEthernet0/0]arp max-learning-num 0
如果在接口下配置max-learning-num之前路由器已经学到了PC2的MAC地址,那么需要等到ARP表项老化后PC2才无法上网。也可以手工清空ARP表项。
手工清空ARP表项命令:
<MSR>reset arp interface GigabitEthernet 0/0
测试:
没有配置max-learning-num之前做ping测试:
[PC1]ping 10.0.0.3
Ping 10.0.0.3 (10.0.0.3): 56 data bytes, press CTRL_C to break
56 bytes from 10.0.0.3: icmp_seq=0 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=1 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=2 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=4 ttl=255 time=1.000 ms
--- Ping statistics for 10.0.0.3 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms
[H3C]%Dec 20 19:29:31:541 2017 H3C PING/6/PING_STATISTICS: Ping statistics for 10.0.0.3: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms.
<PC2>ping 10.0.0.3
Ping 10.0.0.3 (10.0.0.3): 56 data bytes, press CTRL_C to break
56 bytes from 10.0.0.3: icmp_seq=0 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=1 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=2 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=4 ttl=255 time=1.000 ms
--- Ping statistics for 10.0.0.3 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms
<H3C>%Dec 20 19:31:07:622 2017 H3C PING/6/PING_STATISTICS: Ping statistics for 10.0.0.3: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms.
[MSR]dis arp interface GigabitEthernet 0/0
Type: S-Static D-Dynamic O-Openflow R-Rule M-Multiport I-Invalid
IP address MAC address SVLAN/VSI Interface/Link ID Aging Type
10.0.0.1 74e4-011f-0306 -- GE0/0 -- S
10.0.0.2 74e4-0ddc-0406 -- GE0/0 19 D
配置max-learning-num之后做ping测试(ping之前先清空ARP表项):
[PC1]ping 10.0.0.3
Ping 10.0.0.3 (10.0.0.3): 56 data bytes, press CTRL_C to break
56 bytes from 10.0.0.3: icmp_seq=0 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=1 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=2 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=3 ttl=255 time=1.000 ms
56 bytes from 10.0.0.3: icmp_seq=4 ttl=255 time=1.000 ms
--- Ping statistics for 10.0.0.3 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms
[H3C]%Dec 20 19:35:11:960 2017 H3C PING/6/PING_STATISTICS: Ping statistics for 10.0.0.3: 5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss, round-trip min/avg/max/std-dev = 1.000/1.000/1.000/0.000 ms.
<PC2>ping 10.0.0.3
Ping 10.0.0.3 (10.0.0.3): 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- Ping statistics for 10.0.0.3 ---
5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss
<H3C>%Dec 20 19:36:54:220 2017 H3C PING/6/PING_STATISTICS: Ping statistics for 10.0.0.3: 5 packet(s) transmitted, 0 packet(s) received, 100.0% packet loss.
[MSR]dis arp interface GigabitEthernet 0/0
Type: S-Static D-Dynamic O-Openflow R-Rule M-Multiport I-Invalid
IP address MAC address SVLAN/VSI Interface/Link ID Aging Type
10.0.0.1 74e4-011f-0306 -- GE0/0 -- S
1、在接口下配置max-learning-num之前,如果路由器已经学到了PC2的MAC地址,那么配置该命令无法立即生效,需要等到ARP表项老化后PC2才会无法上网。所以在配置完成后,可以手工清空ARP表项。
2、reset arp all命令会把所有arp表项删除,包括静态ARP的配置。所以可以通过reset arp interface GigabitEthernet 0/0清空接口ARP的动态表项。
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论