{"id":1905,"date":"2019-05-10T23:10:37","date_gmt":"2019-05-10T15:10:37","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1905"},"modified":"2019-05-10T23:10:43","modified_gmt":"2019-05-10T15:10:43","slug":"arp","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/arp","title":{"rendered":"arp\u547d\u4ee4 – \u64cd\u7eb5\u7cfb\u7edfarp\u7f13\u5b58"},"content":{"rendered":"\n

arp\u547d\u4ee4\u7684\u82f1\u6587\u5168\u62fc\u201cAddress Resolution Protocol\u201d \u3002\u8be5\u547d\u4ee4\u7528\u4e8e\u64cd\u4f5c\u4e3b\u673a\u7684arp\u7f13\u5b58\uff0c\u5b83\u53ef\u4ee5\u663e\u793aarp\u7f13\u5b58\u4e2d\u7684\u6240\u6709\u6761\u76ee\u3001\u5220\u9664\u6307\u5b9a\u7684\u6761\u76ee\u6216\u8005\u6dfb\u52a0\u9759\u6001\u7684ip\u5730\u5740\u4e0eMAC\u5730\u5740\u5bf9\u5e94\u5173\u7cfb\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a <\/strong>arp [\u53c2\u6570] [IP]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-a<\/td>\u663e\u793aarp\u7f13\u5b58\u7684\u6240\u6709\u6761\u76ee\uff0c\u4e3b\u673a\u4f4d\u53ef\u9009\u53c2\u6570<\/td><\/tr>
-H<\/td>\u6307\u5b9aarp\u6307\u4ee4\u4f7f\u7528\u7684\u5730\u5740\u7c7b\u578b<\/td><\/tr>
-d<\/td>\u4ecearp\u7f13\u5b58\u4e2d\u5220\u9664\u6307\u5b9a\u4e3b\u673a\u7684arp\u6761\u76ee<\/td><\/tr>
-D<\/td>\u4f7f\u7528\u6307\u5b9a\u63a5\u53e3\u7684\u786c\u4ef6\u5730\u5740<\/td><\/tr>
-e<\/td>\u4ee5linux\u7684\u663e\u793a\u98ce\u683c\u663e\u793aarp\u7f13\u5b58\u4e2d\u7684\u6761\u76ee<\/td><\/tr>
-i<\/td>\u6307\u5b9a\u8981\u64cd\u4f5carp\u7f13\u5b58\u7684\u7f51\u7edc\u63a5\u53e3 <\/td><\/tr>
-n<\/td>\u4ee5\u6570\u5b57\u65b9\u5f0f\u663e\u793aarp\u7f13\u5b58\u4e2d\u7684\u6761\u76ee <\/td><\/tr>
-v<\/td>\u663e\u793a\u8be6\u7ec6\u7684arp\u7f13\u5b58\u6761\u76ee\uff0c\u5305\u62ec\u7f13\u5b58\u6761\u76ee\u7684\u7edf\u8ba1\u4fe1\u606f <\/td><\/tr>
-f<\/td>\u8bbe\u7f6e\u4e3b\u673a\u7684IP\u5730\u5740\u4e0eMAC\u5730\u5740\u7684\u9759\u6001\u6620\u5c04<\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u672c\u673aarp\u7f13\u5b58\u4e2d\u6240\u6709\u8bb0\u5f55\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# arp
Address HWtype HWaddress Flags Mask Iface
gateway ether 00:03:0f:81:6b:f1 C ens160<\/pre>\n\n\n\n

\u4ee5\u6570\u5b57\u65b9\u5f0f\u663e\u793a\u6307\u5b9a\u4e3b\u673aarp\u7f13\u5b58\u6761\u76ee\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# arp -n 192.168.60.1
Address HWtype HWaddress Flags Mask Iface
192.168.60.1 ether 00:03:0f:81:6b:f1 C ens160<\/pre>\n\n\n\n

\u5220\u9664\u63a5\u53e3eth1\u4e0a\u7684192.168.60.1\u7684arp\u8868\u4e2d\u7684\u9879\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# arp -i eth1 -d 192.168.60.1<\/pre>\n\n\n\n

\u4f7f\u7528eth1\u7684MAC\u5730\u5740\u56de\u7b54eth0\u4e0a\u7684192.168.60.2\u7684arp\u8bf7\u6c42\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# arp -i eth0 -Ds 192.168.60.2 eth1 pub <\/pre>\n","protected":false},"excerpt":{"rendered":"

arp\u547d\u4ee4\u7684\u82f1\u6587\u5168\u62fc\u201cAddress Resolution Protocol\u201d \u3002\u8be5\u547d\u4ee4\u7528\u4e8e\u64cd\u4f5c\u4e3b\u673a\u7684arp\u7f13 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1905"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1905"}],"version-history":[{"count":9,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":1946,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1905\/revisions\/1946"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}