{"id":240,"date":"2018-03-13T09:46:06","date_gmt":"2018-03-13T01:46:06","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=240"},"modified":"2018-03-13T09:46:06","modified_gmt":"2018-03-13T01:46:06","slug":"dhcping%e5%92%8carping%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=240","title":{"rendered":"dhcping\u548carping\u7684\u4f7f\u7528"},"content":{"rendered":"<p><span style=\"font-size: x-large;\"><b>dhcping\u4f7f\u7528<\/b><\/span><\/p>\n<div><\/div>\n<div><b>\u5b89\u88c5\uff1a<\/b><\/div>\n<div>#\u00a0tar -zxvf dhcping-1.2.tar.gz<\/div>\n<div># cd dhcping-1.2<\/div>\n<div># .\/configure<\/div>\n<div># make<\/div>\n<div># make install<\/div>\n<div><\/div>\n<div><b>\u4f7f\u7528\uff1a<\/b><\/div>\n<div><span style=\"color: #ff0000;\"># dhcping -r -c 10.10.192.10 -s 10.10.192.11 -h D4:85:64:59:DA:FC<\/span><br \/>\nGot answer from: 10.10.192.11<\/div>\n<div><\/div>\n<div>\u5176\u4e2d10.10.192.10\u4e3a\u5ba2\u6237\u7aef\u5730\u5740\uff0c10.10.192.11\u4e3aDHCP\u670d\u52a1\u5668\u5730\u5740\uff0cD4:85:64:59:DA:FC\u4e3a\u5ba2\u6237\u7aefmac\u5730\u5740\u3002<\/div>\n<div><\/div>\n<div><\/div>\n<div><b>\u5e2e\u52a9\uff1a<\/b><\/div>\n<div>\u00a0 \u00a0 \u00a0 \u00a0dhcping [-v] [-q] [-i] [-r] -t maxwait -c client-IP-address -s server-IP-address -h client-hardware-address [-g<br \/>\ngateway-IP-address]<\/p>\n<p>DESCRIPTION<br \/>\nThis command allows the system administrator to check if a remote DHCP server is still functioning.<\/p>\n<p>Options are:<\/p>\n<p>-v\u00a0\u00a0 Verbose, print some information.<\/p>\n<p>-i\u00a0\u00a0 Use DHCPINFORM packets.<\/p>\n<p>-r\u00a0\u00a0 Use DHCPREQUEST packets (default behaviour).<\/p>\n<p>-q\u00a0\u00a0 Quiet, print nothing on the screen.<\/p>\n<p>-t maxwait<br \/>\nMaximum time to wait for an answer from the server in seconds.\u00a0 Default is 3 seconds.<\/p>\n<p>-c client-IP-address<br \/>\nRequest this IP address. Note that this is also the IP address the answer will be sent to.<\/p>\n<p>-s server-IP-address<br \/>\nSend the DHCP packet to this IP address.<\/p>\n<p>-h client-hardware-address<br \/>\nUse this hardware-address in the DHCP request. It can be up to sixteen octets seperated by colons (i.e.<br \/>\n01:02:03:04)<\/p>\n<p>-g gateway-IP-address<br \/>\nUse this IP address for the gateway IP address in the DHCP packet.\u00a0 This option is currently broken.<\/p><\/div>\n<div><\/div>\n<p><span style=\"font-size: x-large;\"><b>arping\u7684\u4f7f\u7528<\/b><\/span><\/p>\n<div>arping\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u547d\u4ee4\uff1a<\/span><br \/>\n<span style=\"font-family: \u5b8b\u4f53;\">\u8bf4\u660e\uff1a<\/span>arping<span style=\"font-family: \u5b8b\u4f53;\">\u662f\u7528\u4e8e\u53d1\u9001<\/span>arp<span style=\"font-family: \u5b8b\u4f53;\">\u8bf7\u6c42\u5230\u4e00\u4e2a\u76f8\u90bb\u4e3b\u673a\u7684\u5de5\u5177\uff1b<\/span><br \/>\narping<span style=\"font-family: \u5b8b\u4f53;\">\u4f7f\u7528<\/span>arp<span style=\"font-family: \u5b8b\u4f53;\">\u6570\u636e\u5305\uff0c\u901a\u8fc7<\/span>ping<span style=\"font-family: \u5b8b\u4f53;\">\u547d\u4ee4\u68c0\u67e5\u8bbe\u5907\u4e0a\u7684\u786c\u4ef6\u5730\u5740\u3002<\/span><br \/>\n<span style=\"font-family: \u5b8b\u4f53;\">\u8bed\u6cd5\uff1a<\/span>arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination<br \/>\n<span style=\"font-family: \u5b8b\u4f53;\">\u53c2\u6570\uff1a<\/span><br \/>\n<span style=\"font-family: Wingdings;\"><br \/>\n<\/span>-c count<span style=\"font-family: \u5b8b\u4f53;\">\u8868\u793a\u53d1\u9001\u6307\u5b9a\u6570\u91cf\u7684<\/span>\u00a0ARP\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u8bf7\u6c42\u6570\u636e\u5305\u540e\u5c31\u505c\u6b62\u3002\u5982\u679c\u5236\u5b9a\u4e86<\/span>deadline<span style=\"font-family: \u5b8b\u4f53;\">\u9009\u9879\uff0c\u5219<\/span>arping<span style=\"font-family: \u5b8b\u4f53;\">\u4f1a\u7b49\u5f85\u76f8\u540c\u6570\u91cf\u7684<\/span>arp<span style=\"font-family: \u5b8b\u4f53;\">\u54cd\u5e94\u5305\uff0c\u76f4\u5230\u8d85\u65f6\u4e3a\u6b62\uff1b<\/span><br \/>\n<span style=\"font-family: Wingdings;\"><br \/>\n<\/span>-b\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u7528\u4e8e\u53d1\u9001\u4ee5\u592a\u7f51\u5e7f\u64ad\u5e27\uff08<\/span>FFFFFFFFFFFF<span style=\"font-family: \u5b8b\u4f53;\">\uff09\u3002<\/span>arping<span style=\"font-family: \u5b8b\u4f53;\">\u4e00\u5f00\u59cb\u4f7f\u7528\u5e7f\u64ad\u5730\u5740\uff0c\u5728\u6536\u5230\u54cd\u5e94\u540e\u5c31\u4f7f\u7528<\/span>unicast<span style=\"font-family: \u5b8b\u4f53;\">\u5730\u5740\u3002<\/span><br \/>\n-w timeout<span style=\"font-family: \u5b8b\u4f53;\">\u8bbe\u5b9a\u4e00\u4e2a\u8d85\u65f6\u65f6\u95f4\uff0c\u5355\u4f4d\u662f\u79d2\u3002\u5982\u679c\u5230\u4e86\u6307\u5b9a\u65f6\u95f4\uff0c<\/span>arping\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u8fd8\u6ca1\u6709\u5b8c\u5168\u6536\u5230\u54cd\u5e94\u5219\u9000\u51fa\uff1b<\/span><br \/>\n-q quiet output\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u4e0d\u663e\u793a\u4efb\u4f55\u4fe1\u606f\uff1b<\/span><br \/>\n-f\u00a0<span style=\"font-family: \u5b8b\u4f53;\">\u8868\u793a\u5728\u6536\u5230\u7b2c\u4e00\u4e2a\u54cd\u5e94\u5305\u540e\u5c31\u9000\u51fa\uff1b<\/span><br \/>\n-s source\u8bbe\u5b9a\u00a0arping\u00a0\u53d1\u9001\u7684\u00a0arp\u00a0\u6570\u636e\u5305\u4e2d\u7684\u00a0 \u00a0SPA\u00a0\u5b57\u6bb5\u7684\u503c\u3002\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u6309\u4e0b\u9762\u5904\u7406<br \/>\n\u5982\u679c\u662f\u00a0DAD\u00a0\u6a21\u5f0f\uff08\u51b2\u7a81\u5730\u5740\u63a2\u6d4b\uff09\uff0c\u5219\u8bbe\u7f6e\u4e3a\u00a00.0.0.0\uff1b<br \/>\n\u5982\u679c\u662f\u00a0Unsolicited ARP\u00a0\u6a21\u5f0f\uff08Gratutious ARP\uff09\u5219\u8bbe\u7f6e\u4e3a\u76ee\u6807\u5730\u5740\uff1b<br \/>\n\u5426\u5219\u4ece\u8def\u7531\u8868\u5f97\u51fa\uff1b<br \/>\n-I interface<span style=\"font-family: \u5b8b\u4f53;\">\u8bbe\u7f6e<\/span>ping<span style=\"font-family: \u5b8b\u4f53;\">\u4f7f\u7528\u7684\u7f51\u7edc\u63a5\u53e3\uff1b<\/span><br \/>\ndestination<span style=\"font-family: \u5b8b\u4f53;\">\u8bbe\u7f6e\u76ee\u6807\u5730\u5740\u3002<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u4f8b\u5982\uff1a<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"># arping -fbq -c 3 -I eth0 10.24.1.7<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u8fd9\u4e2a\u65f6\u5019\u6210\u529f\u5219&#8221;# echo $?&#8221;\u8fd4\u56de0\uff0c\u4e0d\u6210\u529f\u5219\u8fd4\u56de1\u3002<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"># arping -fb -c 3 -I eth0 10.24.1.7<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u53c8\u4f8b\u5982\u7528<b><span style=\"color: #ff0000;\">\u514d\u8d39arp<\/span><\/b>\u5e7f\u64ad\uff1a<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"># arping -U -b -c 3 -I eth0 10.24.1.40<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u5982\u679c\u4f7f\u7528\u5207\u6362\u7684VIP\uff0c\u5219VIP\u5207\u6362\u8fc7\u6765\u4e4b\u540e\uff0c\u4f7f\u7528\u8be5\u547d\u4ee4\u6765\u8ba9VIP\u5730\u5740\u7684\u65b0mac\u5730\u5740\u5e7f\u64ad\u5230\u7f51\u7edc\u4e2d\uff0c\u5176\u4e2d10.24.1.40\u4e3a\u81ea\u5df1\u7684eth0\u7684\u5730\u5740\uff0c\u8be5arp\u5305\u4e0d\u9700\u8981\u56de\u5e94\uff0c\u6240\u4ee5\u53d1\u9001\u4e09\u4e2a\u8bf7\u6c42\u5305\uff0c\u6ca1\u6709\u54cd\u5e94\u5305\uff0c\u7528&#8221;echo $?&#8221;\u4f1a\u8fd4\u56de0\u3002<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"color: #ff0000; font-family: \u5b8b\u4f53;\">\u53e6\u5916heartbeat\u8f6f\u4ef6\u91cc\u9762\u6709\u4e2asend_arp\u7a0b\u5e8f\u8ddfarping\u5b8c\u5168\u4e00\u6837\u3002<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"><b>arping\u68c0\u6d4bip\u51b2\u7a81<\/b><\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div>\n<p><span style=\"font-family: \u5b8b\u4f53;\">ip\u51b2\u7a81\u662f\u4e2a\u5f88\u57fa\u672c\uff0c\u4e5f\u5f88\u4e0d\u5e94\u8be5\u72af\u7684\u9519\u8bef\uff0c\u6211\u6765\u5230\u8fd9\u4e2a\u516c\u53f83\u5e74\u6765\uff0c\u53ea\u9047\u5230\u8fc72\u6b21\uff0c\u4f46\u8fd9\u4e24\u6b21\u90fd\u5f88\u81f4\u547d\uff0c\u90fd\u662f\u5728\u5f88\u5173\u952e\u7684\u4ea7\u54c1\u4e0a\u51fa\u4e86\u95ee\u9898\uff0c\u5982\u679c\u60a8\u4e5f\u60f3\u4ed4\u7ec6\u4e86\u89e3\u54e6arp\u76f8\u5173\u7684\u66f4\u6df1\u5c42\u6b21\u7684\u77e5\u8bc6\uff0c\u6211\u613f\u610f\u628a\u6211\u4eec\u7814\u7a76\u7684\u7ed3\u679c\u5171\u4eab\u51fa\u6765\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u7814\u7a76\u4e86\u4e00\u4e0barping\u547d\u4ee4\u7684\u5de5\u4f5c\u673a\u5236\u548c\u539f\u7406\uff0c\u5e76\u8be6\u7ec6\u7684\u67e5\u770b\u4e86arping\u547d\u4ee4\u7684\u6e90\u7801\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u5217\u51fa\u51e0\u4e2a\u6211\u4eec\u5728\u68c0\u67e5ip\u5730\u5740\u51b2\u7a81\u65f6\u5019\u6bd4\u8f83\u6709\u7528\u7684\u53c2\u6570\uff1a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000arping\u00a0 [\u00a0 -AbDfhqUV]\u00a0\u00a0 [\u00a0 -c count]\u00a0 [ -w deadline]\u00a0 [ -s source]\u00a0 -I interface destination<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000# \u6ce8\u91ca \uff1aarping \u662f\u7528\u4e8e\u53d1\u9001 ARP \u8bf7\u6c42\u5230\u4e00\u4e2a\u76f8\u90bb\u4e3b\u673a\u7684\u5de5\u5177<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000-b\u00a0\u00a0 # \u6ce8\u91ca \uff1a-b \u7528\u4e8e\u53d1\u9001\u4ee5\u592a\u7f51\u5e7f\u64ad\u5e27(FFFFFFFFFFFF) \u3002arping \u4e00\u5f00\u59cb\u4f7f\u7528\u5e7f\u64ad\u5730\u5740\uff0c\u5728\u6536\u5230\u54cd\u5e94\u540e\u5c31\u4f7f\u7528 unicast \u5730\u5740\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000-c count # \u6ce8\u91ca \uff1a-c \u8868\u793a\u53d1\u9001\u6307\u5b9a\u6570\u91cf\u7684 ARP \u8bf7\u6c42\u6570\u636e\u5305\u540e\u5c31\u505c\u6b62\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000-I interface # \u6ce8\u91ca \uff1a-I \u6307\u5b9a\u7528\u90a3\u4e2a\u63a5\u53e3\u6765\u53d1\u9001 ARP \u8bf7\u6c42\u5305\u3002\u8fd9\u4e2a\u9009\u9879\u662f\u5fc5\u987b\u7684\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000-s source # \u6ce8\u91ca \uff1a-s \u8bbe\u5b9a arping \u53d1\u9001\u7684 arp \u6570\u636e\u5305\u4e2d\u7684\u00a0 SPA \u5b57\u6bb5\u7684\u503c\u3002\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u6309\u4e0b\u9762\u5904\u7406<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000#\u00a0\u00a0\u00a0\u00a0 -\uff091\u3001\u5982\u679c\u662f DAD \u6a21\u5f0f\uff08\u51b2\u7a81\u5730\u5740\u63a2\u6d4b\uff09\uff0c\u5219\u8bbe\u7f6e\u4e3a 0.0.0.0<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000#\u00a0\u00a0\u00a0\u00a0 -\uff092\u3001\u5982\u679c\u662f Unsolicited ARP \u6a21\u5f0f\uff08Gratutious ARP\uff09\u5219\u8bbe\u7f6e\u4e3a\u76ee\u6807\u5730\u5740<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000#\u00a0\u00a0\u00a0\u00a0 -\uff093\u3001\u5426\u5219\u4ece\u8def\u7531\u8868\u5f97\u51fa<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000<span style=\"color: #ff0000;\">-U\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # \u6ce8\u91ca\uff1a-U \u5c31\u662f\u542f\u7528 Gratutious \u6a21\u5f0f\uff0c\u5b83\u7528\u4e8e\u66f4\u65b0\u522b\u7684\u4e3b\u673a\u4e0a\u7684 ARP \u8868\u4e2d\u672c\u5730\u4e3b\u673a\u7684\u6761\u76ee\u3002\u4e0d\u9700\u8981\u54cd\u5e94\u3002<\/span><\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000 \u3000arping\u547d\u4ee4\u4e2d\u53d1\u9001arp packets\u65f6\u5019\uff0c\u662f\u5f80FF:FF:FF:FF:FF:FF\u8fd9\u4e2a\u4ee5\u592a\u7f51\u5185\u7684\u5e7f\u64ad\u5730\u5740\u53d1\u9001\uff0c\u5305\u62ec\u53d1\u9001arping\u547d\u4ee4\u7684\u672c\u673a\u4e5f\u4f1a\u6536\u5230\u8fd9\u4e2aarp packets\uff08\u4f46\u662f\u672c\u673a\u6536\u5230\u4e4b\u540e\u4e0d\u4f1aReply\u4efb\u4f55\u4fe1\u606f\uff09\u3002\u6bd4\u5982\u5f53\u6211\u4eec\u5728192.168.10.138\u4e0a\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u65f6\uff1a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000arping 192.168.10.139<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u4f1a\u9ed8\u8ba4\u4f7f\u7528eth0\uff0c\u5411\u5c40\u57df\u7f51\u5185\u6240\u6709\u7684\u4e3b\u673a\u53d1\u9001\u4e00\u4e2a\uff1awho-has 192.168.10.139\u7684arp request\uff0ctell 192.168.10.138 your mac address\uff0c\u7c7b\u4f3c\u8fd9\u6837\uff1a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000&#8221;\u6211\u662f\u4e3b\u673a192.168.10.138 , mac\u662fxxxxxxxxxxx ,ip\u4e3a192.168.10.139\u7684\u4e3b\u673a\u8bf7\u544a\u4e4b\u4f60\u7684mac&#8221;<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000 \u3000ip\u4e3a192.168.10.139\u7684\u4e3b\u673a\u54cd\u5e94\u8fd9\u4e2a\u5e7f\u64ad\uff0c\u5e94\u7b54ARP\u5e7f\u64ad\u4e3a\uff1a&#8221;\u6211\u662f192.168.10.139,\u6211\u7684mac\u4e3a xxxxxxxxxx2&#8243;\uff0c\u6b64\u5e94\u7b54\u53ea\u53d1\u56de\u7ed9192.168.10.138\u800c\u4e0d\u662f\u5e7f\u64ad\uff0c\u6536\u5230\u4e4b\u540e\uff0c192.168.10.138\u4e3b\u673a\u5237\u65b0\u81ea\u5df1\u7684ARP\u7f13\u5b58\u3002<\/span><\/p>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u6211\u4eec\u5e73\u65f6\u4f7f\u7528arping\u547d\u4ee4\u68c0\u6d4bip\u5730\u5740\u51b2\u7a81\u7684\u60c5\u666f\u5927\u6982\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u30001\u3001\u4e00\u4e2aip\uff08192.168.10.139\uff09\u88ab\u7ed1\u5728\u4e86\u4e24\u53f0\u6216\u591a\u53f0\u4e0d\u540c\u7684\u673a\u5668\uff08A\u3001B&#8230;\uff09\u4e0a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u4f8b\u5982\u6211\u4eec\u5728192.168.10.138\u8fd9\u53f0\u673a\u5668\u4e0a\u8fdb\u884c\u76d1\u63a7\uff1a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u65b9\u6cd5\u4e00\uff1aarping -I eth1 -c 1 192.168.10.139\u00a0 \u8fd4\u56de\u591a\u4e2amac\u5730\u5740\uff08A\u3001B&#8230;\uff09<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u65b9\u6cd5\u4e8c\uff1aarping -I eth1 -b 192.168.10.139\u00a0 \u6301\u7eed\u7684\u8fd4\u56de\u591a\u4e2amac\u5730\u5740\uff08A\u3001B&#8230;A\u3001B&#8230;\uff09<\/span><\/p>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u6b64\u5904\u6267\u884c\u5b8c\u547d\u4ee4\u4e4b\u540e\u5982\u679c\u51fa\u73b0\u4e86\u591a\u4e2amac\u5730\u5740\uff0c\u5c31\u53ef\u4ee5\u5224\u5b9a\u662f\u5b58\u5728ip\u5730\u5740\u91cd\u590d\u7ed1\u5b9a\u7684\u95ee\u9898<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u30002\u3001\u6709ip\u51b2\u7a81\u7684\u4e00\u53f0\u6216\u591a\u53f0\u673a\u5668\uff08A\u3001B&#8230;\uff09\u4e0a\u53c8\u9519\u8bef\u7684\u7ed1\u7740\u76d1\u63a7\u673a\u7684ip\uff08192.168.10.138\uff09<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u6211\u4eec\u4ecd\u7136\u5728192.168.10.138\u8fd9\u53f0\u673a\u5668\u4e0a\u8fdb\u884c\u76d1\u63a7\uff1a<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000arping -I eth1 -c 1 192.168.10.139<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u6b64\u65f6\u7ed1\u7740\u76d1\u63a7\u673aip\uff08192.168.10.138\uff09\uff0c\u540c\u65f6\u53c8\u7ed1\u7740\uff08192.168.10.139\uff09\u673a\u5668\uff08\u5047\u8bbe\u4e3aA\uff09\u4e0d\u4f1a\u8fd4\u56de\u81ea\u5df1\u7684mac\u5730\u5740\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u56e0\u4e3a\u8fd9\u53f0\u673a\u5668A\u6536\u5230arp\u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u4f1a\u6bd4\u8f83\u6765\u6e90\u5730\u5740\u548c\u81ea\u5df1\u7684ip\u5730\u5740\uff0c\u53d1\u73b0\u6765\u6e90ip\u5b58\u5728\u4e8e\u81ea\u5df1\u7684\u7f51\u5361\u4e0a\uff0c\u4ee5\u592a\u7f51\u534f\u8bae\u4f1a\u8ba4\u4e3a\u8fd9\u4e2a\u5305\u662f\u6765\u81ea\u4e8e\u81ea\u5df1\uff0c\u4e0d\u4e88\u4ee5\u54cd\u5e94\uff0c\u81ea\u7136\u5c31\u4e0d\u4f1a\u6709\u53cd\u9988\u4e86\u3002\u6240\u4ee5\u6b64\u65f6\u6267\u884c\u4e0a\u9762\u7684arping\u547d\u4ee4\u77e5\u4f1a\u6253\u5370\u51fa\u9664\u4e86\u673a\u5668A\u4e4b\u5916\u7ed1\u5b9a\u4e86\uff08192.168.10.139\uff09\u7684\u673a\u5668mac\u5217\u8868\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u89e3\u51b3\u8fd9\u79cd\u7279\u6b8a\u60c5\u51b5\uff0c\u9700\u8981\u4f7f\u7528-s\u53c2\u6570\uff0c\u6307\u5b9a\u4e00\u4e2aip\u4f5c\u4e3a\u6211\u4eec\u53d1\u9001arp packet\u7684source ip\u3002<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000\u6bd4\u5982\u6211\u4eec\u5728\u76d1\u63a7\u673aeth1 192.168.10.138\u4e0a\u9762\u7ed1\u4e00\u4e2a192.168.10.138<\/span><\/p>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000ifconfig eth1:1 192.168.10.138<\/span><\/p>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u3000 \u3000arping -I eth1 -c 1 192.168.10.139 -s 192.168.10.138\uff0c\u6b64\u65f6\u7ed1\u7740\u76d1\u63a7\u673aip\uff08192.168.10.138\uff09\u540c\u65f6\u53c8\u62e5\u6709\uff08192.168.10.139\uff09\u7684\u8fd9\u53f0\u673a\u5668A\u7684mac\u5730 \u5740\u53c8\u4f1a\u6b63\u5e38\u7684\u6253\u5370\u51fa\u6765\u3002\u56e0\u4e3a\u5b83\u6536\u5230arp packet\u7684\u65f6\u5019\uff0c\u5bf9\u6bd4\u6765\u6e90ip\uff0c\u5728\u81ea\u5df1\u7684\u7f51\u5361\u4e0a\u6ca1\u6709\u53d1\u73b0\u6765\u6e90ip\uff0c\u6240\u4ee5\u4f1a\u50cf\u6b63\u5e38arp\u5305\u4e00\u6837\u53cd\u9988\u81ea\u5df1\u7684mac\u5730\u5740\u3002<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<p><span style=\"font-family: \u5b8b\u4f53;\">\u3000\u3000<span style=\"color: #ff0000;\">3\u3001\u5f53\u6709\u65b0\u7684ip\uff08192.168.10.139\uff09\u7ed1\u5b9a\u5728\u673a\u5668A\u4e0a\u65f6\uff0c\u624b\u5de5\u6267\u884c<\/span><\/span><\/p>\n<div><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"color: #ff0000;\">\u00a0<\/span><\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"color: #ff0000;\">\u3000\u3000arping -U -b -c 3 -I eth0:0 192.168.10.139<\/span><\/span><\/div>\n<div><span style=\"color: #ff0000; font-family: \u5b8b\u4f53;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: \u5b8b\u4f53;\"><span style=\"color: #ff0000;\">\u3000\u3000\u8fd9\u6837arp\u4f1a\u5728\u5c40\u57df\u7f51\u91cc\u53d1\u5e7f\u64ad\uff0cGratuitous ARP(\u514d\u8d39ARP\u5305)\uff0c\u544a\u8bc9\u5c40\u57df\u7f51\u5185\u5176\u5b83\u7684\u673a\u5668\u5728arp\u8868\u91cc\u6dfb\u52a0\u4e00\u9879\uff08192.168.10.39\u548cA\u7ed1\u7740\u8be5\u5730\u5740\u7684\u7f51\u5361mac\uff09\uff0c\u8868\u793a\u8fd9\u4e2aip\u5df2\u7ecf\u88ab\u4f7f\u7528\u4e86\uff0c\u8fd9\u6837\u80fd\u66f4\u8fdb\u4e00\u6b65\u5728\u5176\u5b83\u673a\u5668\u7ed1\u5b9aip\u65f6\u907f\u514d\u91cd\u590d\u7ed1\u5b9a\u7684\u95ee\u9898\u3002<\/span><\/span><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>dhcping\u4f7f\u7528 \u5b89\u88c5\uff1a #\u00a0tar -zxvf dhcping-1.2.tar.gz # cd dhcpi &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[160,162,159,161],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry","category-linuxandroid","tag-arping","tag-dhcp","tag-dhcping","tag-ip"],"views":3230,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=240"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":241,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/240\/revisions\/241"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}