Linux<\/a>\u7cfb\u7edf\u7684\u5c0f\u7b14\u8bb0\u672c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5404\u7c7b\u610f\u60f3\u4e0d\u5230\u7684\u529f\u80fd\u3002<\/p>\n\u9700\u6c42<\/p>\n
\u540e\u9762\u4ecb\u7ecd\u4e86\u624b\u91cc\u4e24\u53f0\u8def\u7531\u5668\u7684\u597d\u574f\uff0c\u51b3\u5b9a\u8981\u5b9e\u73b0\u7684\u76ee\u6807\u5982\u4e0b\uff1a<\/p>\n
\u4ee5\u534e\u4e3aA1\uff08\u4ee5\u4e0b\u7b80\u79f0A1\uff09\u4e3a\u4e3b\u8def\u7531\uff0c\u8d1f\u8d23\u62d4\u53f7\u4e0a\u7f51\u548c\u53d1\u9001WIFI\u8baf\u53f7\u3002\u4ee5OpenWrt\u7684\u8def\u7531\u5668\u4e3a\u8f6f\u8def\u7531\uff08\u4ee5\u4e0b\u7b80\u79f0OP\uff09\uff0c\u8d1f\u8d23\u5916\u7f51\u6240\u6709\u8bbe\u5907\u7684IP\u5730\u5740\u5206\u914d\uff08DHCP\uff09\uff0c\u800c\u4e14\u8ba1\u5212\u540e\u671f\u901a\u8fc7\u5b83\u5b9e\u73b0\u5404\u7c7b\u6269\u5145\u529f\u80fd\u3002\u6574\u4e2a\u5c40\u57df\u7f51\u53ea\u8bbe\u7f6e\u4e00\u4e2aIP\u7f51\u5173\uff0c\u6240\u6709\u8bbe\u5907\u90fd\u53ef\u4ee5\u901a\u8fc7\u5916\u7f51IP\u8fdb\u884c\u76f8\u4e92\u8bbf\u95ee\u548c\u5171\u4eab\u3002\u6240\u6709\u8bbe\u5907\u7684\u7f51\u6bb5\u90fd\u624b\u52a8\u914d\u7f6e\u4e3aOP\u8f6f\u8def\u7531\u3002\u5728\u4e3b\u8def\u7531WIFI\u8baf\u53f7\u4e0d\u597d\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u5207\u6362\u5230\u8f6f\u8def\u7531\u7684WIFI\u4e0a\uff0c\u53d8\u76f8\u5b9e\u73b0WIFI\u4e2d\u7ee7\u3002<\/p>\n
\u914d\u7f6e\u8fc7\u7a0b<\/p>\n
\u786c\u4ef6\u8054\u63a5\u3002<\/p>\n
A1\u4f5c\u4e3a\u4e3b\u8def\u7531\uff0c\u5b83\u7684WAN\u53e3\u5e94\u5f53\u8054\u63a5\u5230\u5149\u732b\u4e4b\u4e0a\uff0c\u4e3b\u8def\u7531LAN\u53e3\u63d2\u4e0a\u7f51\u7ebf\u8054\u63a5\u5230OP\u7684LAN\u53e3\uff0c\u6ce8\u610f\u4e0d\u662fWAN\u53e3\u3002<\/p>\n
<\/p>\n
PS.\u5047\u5982\u5bb6\u91cc\u5bb6\u88c5\u65f6\u9884\u57cb\u4ef6\u7684\u7f51\u7ebf\u8db3\u591f\u7684\u8bdd\uff0cOP\u53ef\u4ee5\u653e\u5728WIFI\u8baf\u53f7\u8f83\u5f31\u7684\u5367\u5ba4\uff0c\u5176\u5b9e\u4e5f\u53ef\u4ee5\u901a\u8fc7\u65e0\u7ebf\u6865\u63a5\uff0c\u8fd9\u513f\u4e0d\u8d58\u8a00\u3002<\/p>\n
\u5176\u5b83\u8bbe\u5907\u81ea\u7531\u8054\u63a5\uff0c\u53ef\u4ee5\u662fWIFI\u4e5f\u53ef\u4ee5\u7528\u7f51\u7ebf\u8054\u63a5\u5230\u4efb\u610f\u4e00\u53f0\u8def\u7531\u4e4b\u4e0a\u3002<\/p>\n
\u914d\u7f6eA1\u4e3b\u8def\u7531\u3002<\/p>\n
\u4e3a\u4e86\u9632\u6b62IP\u51b2\u7a81\uff0c\u6211\u7528\u4e86\u4e00\u53f0\u6ca1\u6709\u63a5\u5165\u4efb\u4f55\u7f51\u8def\u7684\u7535\u8111\u7b14\u8bb0\u672c\uff0c\u901a\u8fc7\u7f51\u7ebf\u8054\u63a5\u5230A1\u3002<\/p>\n
\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee192.168.1.1\uff0c\u6b65\u5165A1\u7684\u914d\u7f6e\u9875\u9762\u3002\u8fd9\u513f\u7684IP\u5730\u5740\u4ee5\u4f60\u7684\u8def\u7531\u5668\u5b9e\u9645IP\u4e3a\u51c6linux deepin\uff0c\u4e0d\u4e00\u5b9a\u548c\u6211\u7684\u4e00\u6837\u3002<\/p>\n
PS.\u5018\u82e5\u51fa\u73b0IP\u51b2\u7a81\uff0c\u4e0d\u80fd\u8bbf\u95ee\u914d\u7f6e\u9875\u9762\uff0c\u53ef\u4ee5\u6682\u65f6\u62e8\u51faWAN\u53e3\u548cLAN\u53e3\u7684\u7f51\u7ebf\u3002<\/p>\n
\u6309\u8ba1\u5212\u66f4\u6539\u4e3b\u8def\u7531\u81ea\u8eab\u7684IP\u5730\u5740\uff0c\u6211\u662f\u66f4\u6539\u4e3a192.168.100.1\uff0c\u8ba1\u5212\u6574\u4e2a\u5916\u7f51\u90fd\u5904\u4e8e192.168.100.X\u8fd9\u4e2a\u7f51\u5173\u3002<\/p>\n
<\/p>\n
PS.\u5176\u5b83\u673a\u578b\u7684\u8def\u7531\u5668\u8bf7\u81ea\u884c\u67e5\u8be2\u66f4\u6539\u81ea\u8eabIP\u7684\u65b9\u5f0f\u3002<\/p>\n
OP\u8f6f\u8def\u7531\u7684\u914d\u7f6e\u3002<\/p>\n
\u5c06\u7535\u8111\u7b14\u8bb0\u672c\u8054\u63a5\u5230OP\u4e0a\uff0c\u8bbf\u95ee192.168.1.1\u3002\u8fd9\u4e2aIP\u5730\u5740\u4e5f\u53ef\u80fd\u4f1a\u6709\u4e0d\u540c\uff0c\u4ee5\u4f60\u7684\u4e3a\u51c6\u3002<\/p>\n
\u6211\u7684\u662f\u65e9\u5df2\u8bbe\u7f6e\u597d\u7684\uff0cWAN\u548cWAN6\u7684\u989c\u8272\u4f1a\u4e0e\u4f60\u7684\u4e0d\u4e00\u6837\u3002<\/p>\n
PS.OP\u4e0a\u7684\u7cfb\u7edf\u4e3aOpenWrt19.07\uff0c\u800c\u4e14\u65e9\u5df2\u5b89\u88c5\u4e86LuCI\u754c\u9762\u3002<\/p>\n
<\/p>\n
\u4f9d\u6b21\u70b9\u51fb\u7f51\u8def\u2192\u63a5\u53e3\uff0c\u5206\u522b\u70b9\u51fb\u7f16\u8f91\u5e76\u6309\u4e0b\u4e00\u6b65\u66f4\u6539\u3002<\/p>\n
\u5728\u6570\u5b66\u8bbe\u7f6e\u91cc\u628a\u63d2\u53e3\u6539\u4e3aeth0.1\u3002<\/p>\n
<\/p>\n
\u518d\u628a\u9632\u706b\u5899\u8bbe\u7f6e\u6539\u4e3alan\u3002<\/p>\n
<\/p>\n
WAN6\u4e5f\u662f\u540c\u6837\u7684\u66f4\u6539\uff0c\u66f4\u6539\u5b8c\u6210\u540e\u70b9\u51fb\u4fdd\u5b58\u5e76\u5e94\u7528\u3002<\/p>\n
\u63a5\u51fa\u6765\u66f4\u6539LAN\uff0c\u5728\u7f51\u8def\u2192\u63a5\u53e3\u9875\u9762\uff0c\u70b9\u51fbLAN\u65c1\u8fb9\u7684\u7f16\u8f91\u3002<\/p>\n
<\/p>\n
\u5728\u57fa\u672c\u8bbe\u7f6e\u4e2d\u586b\u5199\u53f3\u56fe\u7ea2\u6846\u4e2d\u7684\u9879\u76ee\uff0cIPv4\u5730\u5740\u524d3\u4f4d\u8981\u548c\u4e3b\u8def\u7531\u7684\u4e00\u6837linux\u5b89\u88c5dhcp\u670d\u52a1<\/strong>linux\u5b89\u88c5dhcp\u670d\u52a1<\/strong>\uff0c\u6700\u540e\u4e00\u4f4d\u8981\u548c\u4e3b\u8def\u7531\u7684\u4e0d\u540c\u3002<\/p>\nPS.\u8fd9\u513f\u8981\u8865\u5145\u4e00\u4e0b\uff0c\u5916\u7f51\u7684IP\u8981\u586b\u4fdd\u7559\u5730\u5740\uff0c\u5047\u5982\u4f60\u4e0d\u61c2\u7684\u8bdd\uff0c\u7167\u6211\u7684\u586b\u5c31\u884c\u4e86\u3002<\/p>\n
<\/p>\n
\u5b50\u7f51\u7f51\u6bb5\u5c31\u586b255.255.255.0\uff0cIPv4\u7f51\u6bb5\u8981\u586b\u6210\u4e3b\u8def\u7531\u7684IP\u3002<\/p>\n
\u4f7f\u7528\u81ea\u5b9a\u4e49\u7684DNS\u670d\u52a1\u5668\uff0c\u53ef\u9009\u7684\u6709114.114.114.114\uff0c8.8.8.8\uff0c8.8.4.4\uff0c127.0.0.1\u7b49linux\u5220\u9664\u6587\u4ef6\u5939\uff0c\u53ef\u4ee5\u586b\u4e00\u4e2a\u6216\u5219\u51e0\u4e2a\u4e00\u8d77\u586b\uff0c\u70b9\u65c1\u8fb9\u7684\u51cf\u53f7\u5c31\u53ef\u4ee5\u964d\u4f4e\uff0c\u5018\u82e5\u4e0d\u61c2\uff0c\u586b\u4e24\u4e2a\u8def\u7531\u5668\u7684IP\u5c31\u884c\u3002<\/p>\n
\u5176\u5b83\u7684\u9ed8\u8ba4\u5373\u53ef\uff0c\u4fdd\u5b58\u5e76\u5e94\u7528\u3002<\/p>\n
\u5373\u5c06\u7ec4\u7f51\u3002<\/p>\n
\u5047\u5982\u4f60\u4e4b\u524d\u62e8\u6389\u4e86\u7f51\u7ebf\uff0c\u91cd\u65b0\u8054\u63a5\u597d\uff0c\u91cd\u542f\u4e00\u4e0b\u4e24\u4e2a\u8def\u7531\u5668\u3002\u4e4b\u524d\u8054\u7f51\u7684\u8bbe\u5907\u65ad\u6389\u4e00\u4e0b\u91cd\u65b0\u8054\u63a5\u3002<\/p>\n
<\/p>\n
PS.\u7b14\u8bb0\u672c\u53ef\u4ee5\u7981\u7528\u4e00\u4e0b\u672c\u5730\u8054\u63a5\u91cd\u65b0\u542f\u7528\u5373\u53ef\u3002<\/p>\n
\u8fd9\u4e00\u6b65\u662f\u8ba9\u7f51\u5185\u6240\u6709\u8bbe\u5907\u91cd\u65b0\u83b7\u53d6IP\u5730\u5740\u3002\u8fd9\u6837\u6240\u6709\u7684\u8bbe\u5907\u5c31\u5904\u4e8e\u540c\u4e00\u4e2a\u5c40\u57df\u7f51\u4e2d\u4e86\u3002<\/p>\n
\u540e\u7eed\u8bbe\u7f6e\u3002<\/p>\n
\u6839\u636e\u4e4b\u524d\u7684\u8bbe\u7f6e\uff0c\u73b0\u4eca\u7f51\u5185\u4efb\u610f\u4e00\u53f0\u8bbe\u5907\u8bbf\u95ee192.168.100.2\u8fd9\u4e2aIP\uff0c\u80fd\u591f\u6253\u5f00OP\u7684\u8bbe\u7f6e\u754c\u9762\u4e86\u3002<\/p>\n
\u6b65\u5165OP\u8bbe\u7f6e\u754c\u9762\u540e\uff0c\u6309\u56fe\u70b9\u51fb\uff0c\u6dfb\u52a0\u8fd9\u6761\u9632\u706b\u5899\u89c4\u5219\uff1a<\/p>\n
\n
iptables -t nat -I POSTROUTING -j MASQUERADE<\/code><\/pre>\n<\/p>\n<\/p>\n
\u518d\u70b9\u51fb\u91cd\u542f\u9632\u706b\u5899\u3002<\/p>\n
\u518d\u5ea6\u6b65\u5165\u7f51\u8def\u2192\u63a5\u53e3\u2192LAN\u2192\u7f16\u8f91\uff0c\u4e0b\u62c9\u5230DHCP\u670d\u52a1\u5668\uff0c\u70b9\u51fb\u4e2d\u7ea7\u8bbe\u7f6e\uff0c\u52fe\u9009\u5f3a\u5236\u3002<\/p>\n
<\/p>\n
<\/p>\n
PS.\u8fd9\u4e00\u6b65\u662f\u8ba9\u6240\u6709\u5916\u7f51\u8bbe\u5907\u7684IP\u90fd\u901a\u8fc7OP\u8f6f\u8def\u7531\u5206\u53d1\uff0c\u8fd9\u6837\uff0c\u6240\u6709\u8bbe\u5907\uff0c\u4e0d\u7ba1\u662f\u8054\u63a5\u5728\u4e3b\u8def\u7531\u4e0a\u7684\u8fd8\u662f\u8f6f\u8def\u7531\u4e0a\u7684\uff0c\u7f51\u6bb5\u5c31\u4f1a\u624b\u52a8\u5f04\u6210\u8f6f\u8def\u7531\uff0c\u4fbf\u6377\u63a5\u51fa\u6765\u5b9e\u73b0\u5168\u8bbe\u5907\u79d1\u5b66\u4e0a\u7f51\u3002<\/p>\n
\u6700\u540e\uff0c\u91cd\u65b0\u56de\u5230\u4e3b\u8def\u7531\u7684\u8bbe\u7f6e\u9875\u9762\uff0c\u5173\u6389\u4e3b\u8def\u7531DHCP\u670d\u52a1\u3002<\/p>\n
<\/p>\n
\u6240\u6709\u8bbe\u5907\u65ad\u6389\u8054\u63a5\u800c\u4e14\u91cd\u8fde\uff0c\u67e5\u770b\u8bbe\u5907\u7684\u7f51\u6bb5\uff0c\u65e9\u5df2\u5f04\u6210\u4e86192.168.100.2\uff0c\u662f\u8f6f\u8def\u7531\u7684IP\u3002<\/p>\n
<\/p>\n
\u5047\u5982\u4e4b\u524d\u7684\u8bbe\u7f6e\u6b63\u786e\uff0c\u76ee\u524d\u8bbf\u95ee192.168.100.1\u53ef\u4ee5\u6b65\u5165\u4e3b\u8def\u7531\u8bbe\u7f6e\uff0c\u8bbf\u95ee192.168.100.2\u53ef\u4ee5\u6b65\u5165\u8f6f\u8def\u7531\u8bbe\u7f6e\u3002<\/p>\n
\u7ed3\u8bed<\/p>\n
\u5982\u4eca\uff0c\u89e3\u51b3\u4e86\u5bb6\u91cc\u7684\u8bbe\u5907WIFI\u65ad\u6d41\u7684\u60c5\u51b5\uff0c\u7531\u4e8eA1\u7684WIFI\u8fd8\u662f\u6bd4\u8f83\u7a33\u5b9a\u7684\u3002<\/p>\n
\u4e5f\u89e3\u51b3\u4e86A1WiFi\u7a7f\u5899\u8baf\u53f7\u5f31\u7684\u60c5\u51b5\uff0c\u5728\u8baf\u53f7\u8f83\u5f31\u7684\u5367\u5ba4\uff0c\u6211\u66f4\u6362\u8054\u63a5\u5230OP\u7684WIFI\u4e0a\u5373\u53ef\u3002<\/p>\n
\u6709\u4e86\u5f3a\u608d\u7684OpenWrt\u4f5c\u4e3a\u8f6f\u8def\u7531\uff0c\u63a5\u51fa\u6765\u6709\u66f4\u591a\u7684\u529f\u80fd\u53ef\u4ee5\u6269\u5145\uff0c\u8bf8\u5982\u79d1\u5b66\u4e0a\u7f51\uff0c\u5927\u578bNAS\u670d\u52a1\u5668\uff0cFrp\uff0c\u79bb\u7ebf\u4e0b\u8f7d\uff0c\u8fdc\u7a0b\u63a7\u5236\uff0c\u7f51\u9875\u670d\u52a1\u7b49\uff0c\u8fd9\u79cd\u90fd\u662f\u6211\u63a5\u51fa\u6765\u6253\u7b97\u6298\u817e\u7684\uff0c\u6211\u4f1a\u628a\u6298\u817e\u7684\u8fc7\u7a0b\u4e00\u4e00\u8bb0\u5f55\u51fa\u6765\u3002<\/p>\n
[\u6bd4\u5fc3]\u6709\u7528\u7684\u8bdd\u70b9\u4e2a\u8d5e\u5457\uff01[\u6bd4\u5fc3]<\/p>\n","protected":false},"excerpt":{"rendered":"
\u6240\u6709\u8bbe\u5907\u7684\u7f51\u5173\u90fd\u81ea\u52a8\u914d\u7f6e\u4e3aOP\u8f6f\u8def\u7531\u3002PS.\u5176\u5b83\u578b\u53f7\u7684\u8def\u7531\u5668\u8bf7\u81ea\u884c\u67e5\u8be2\u4fee\u6539\u81ea\u8eabIP\u7684\u65b9\u6cd5\u3002PS.\u8fd9\u4e00\u6b65\u662f\u8ba9\u6240\u6709\u5185\u7f51\u8bbe\u5907\u7684IP\u90fd\u901a\u8fc7OP\u8f6f\u8def\u7531\u5206\u53d1\uff0c\u8fd9\u6837\uff0c\u6240\u6709\u8bbe\u5907\uff0c\u4e0d\u7ba1\u662f\u8fde\u63a5\u5728\u4e3b\u8def\u7531\u4e0a\u7684\u8fd8\u662f\u8f6f\u8def\u7531\u4e0a\u7684\uff0c\u7f51\u5173\u90fd\u4f1a\u81ea\u52a8\u53d8\u6210\u8f6f\u8def\u7531\uff0c\u65b9\u4fbf\u63a5\u4e0b\u6765\u5b9e\u73b0\u5168\u8bbe\u5907\u79d1\u5b66\u4e0a\u7f51\u3002<\/p>\n","protected":false},"author":1,"featured_media":286175,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-286174","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/286174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=286174"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/286174\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/286175"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=286174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=286174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=286174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}