{"id":582,"date":"2020-01-30T12:11:19","date_gmt":"2020-01-30T04:11:19","guid":{"rendered":"http:\/\/h2.wjxy.net.cn:8081\/?p=582"},"modified":"2023-10-04T06:50:09","modified_gmt":"2023-10-03T22:50:09","slug":"docker-%e4%b8%ad%e8%bf%90%e8%a1%8c-openwrt-%e6%97%81%e8%b7%af%e7%bd%91%e5%85%b3","status":"publish","type":"post","link":"https:\/\/www.wjxy.net.cn\/?p=582","title":{"rendered":"Docker \u4e2d\u8fd0\u884c OpenWrt \u65c1\u8def\u7f51\u5173"},"content":{"rendered":"\r\n<p>\u53c2\u8003\uff1a <a href=\"https:\/\/mlapp.cn\/376.html\">https:\/\/mlapp.cn\/376.html<\/a><\/p>\r\n\r\n\r\n\r\n<p><code>docker run --restart always --name openwrt -d --network macnet --privileged registry.cn-hangzhou.aliyuncs.com\/wjxy\/openwrt:001 \/sbin\/init<\/code><\/p>\r\n\r\n\r\n\r\n<p>docker \u5bbf\u4e3b\u7684\u4e92\u8bbf\uff1a<\/p>\r\n\r\n\r\n\r\n<p>ip link add macvlan link eth0 type macvlan mode bridge<br \/>ip addr add 192.168.123.2\/24 dev macvlan \uff08192.168.123.2\/24\u53ef\u4ee5\u4e3aeth0\u7684IP)<br \/>ip link set macvlan up<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"\u6b65\u9aa4\u5f00\u59cb\">\u6b65\u9aa4\u5f00\u59cb<\/h2>\r\n\r\n\r\n\r\n<p>\u6210\u529f\u767b\u9646\u5230\u6811\u8393\u6d3e\u7684 SSH \u540e\uff0c\u5728\u62c9\u53d6\u955c\u50cf\u4e4b\u524d\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u989d\u5916\u7684\u5de5\u4f5c\uff1a<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"1-\u6253\u5f00\u7f51\u5361\u6df7\u6742\u6a21\u5f0f\">1.\u6253\u5f00\u7f51\u5361\u6df7\u6742\u6a21\u5f0f<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>sudo ip link set eth0 promisc on<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"2-\u521b\u5efa\u7f51\u7edc\">2.\u521b\u5efa\u7f51\u7edc<\/h3>\r\n\r\n\r\n\r\n<p><strong>(\u987b\u7ed3\u5408\u5b9e\u9645\u7f51\u7edc\u60c5\u51b5\uff0c\u4e0d\u80fd\u7167\u6284\u547d\u4ee4)<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker network create -d macvlan &#8211;subnet=192.168.123.0\/24 &#8211;gateway=192.168.123.1 -o parent=eth0 macnet<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u8fd9\u4e00\u6761\u547d\u4ee4\u9700\u8981\u6839\u636e\u6811\u8393\u6d3e\u6240\u5904\u7684\u7f51\u7edc\u73af\u5883\u6765\u505a\u4fee\u6539\uff0c\u53ef\u4ee5\u4f7f\u7528\u00a0<code>sudo ifconfig<\/code>\u547d\u4ee4\u6765\u67e5\u770b\u6811\u8393\u6d3e eth0 \u7f51\u5361\u83b7\u5f97\u7684 IP \u5730\u5740\uff0c\u5982\u679c\u6811\u8393\u6d3e\u83b7\u5f97\u7684 IP \u5730\u5740\u4e3a\u00a0<code>192.168.2.154<\/code>\uff0c\u90a3\u4e48\u8bf4\u660e\u6811\u8393\u6d3e\u5904\u5728\u00a0<code>192.168.2.x<\/code>\u7f51\u6bb5\uff0c\u76f8\u5e94\u7684\uff0c\u547d\u4ee4\u4e2d\u7684<code>192.168.123.0<\/code>\u548c<code>192.168.123.1<\/code>\u9700\u8981\u88ab\u66ff\u6362\u6210\u00a0<code>192.168.2.0<\/code>\u548c<code>192.168.2.1<\/code>\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker network create -d macvlan &#8211;subnet=192.168.2.0\/24 &#8211;gateway=192.168.2.1 -o parent=eth0 macnet<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u6b64\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u00a0<code>docker network ls<\/code>\u547d\u4ee4\u53ef\u4ee5\u770b\u5230\u7f51\u7edc<code>macnet<\/code>\u5df2\u5efa\u7acb\u6210\u529f\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>$ docker network ls<br \/>NETWORK ID NAME DRIVER SCOPE<br \/>10e676133746 bridge bridge local<br \/>f5308b94e8fa host host local<br \/>16745ea66852 macnet macvlan local<br \/>5e72e41ea02a none null local<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"3-\u62c9\u53d6\u955c\u50cf\">3.\u62c9\u53d6\u955c\u50cf<\/h3>\r\n\r\n\r\n\r\n<p>\u82e5\u8eab\u5904\u56fd\u5185\uff0c\u4e3a\u63d0\u9ad8\u62c9\u53d6\u901f\u5ea6\uff0c\u8bf7\u62c9\u53d6\u963f\u91cc\u4e91\u4ed3\u5e93\u4e2d\u7684\u955c\u50cf\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker pull registry.cn-shanghai.aliyuncs.com\/suling\/openwrt:latest<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u540c\u65f6\u5c0f\u82cf\u4e5f\u63d0\u4f9b\u5b58\u653e\u5728\u00a0<a href=\"https:\/\/hub.docker.com\/r\/sulinggg\/openwrt\" target=\"_blank\" rel=\"noreferrer noopener\">Docker \u5b98\u65b9\u4ed3\u5e93<\/a>\u00a0\u4e2d\u7684\u955c\u50cf\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker pull sulinggg\/openwrt:latest<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u955c\u50cf\u62c9\u53d6\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u6267\u884c<code>docker images<\/code>\u547d\u4ee4\u67e5\u770b\u73b0\u5b58\u955c\u50cf\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>$ docker images<br \/>REPOSITORY TAG IMAGE ID CREATED SIZE<br \/>registry.cn-shanghai.aliyuncs.com\/suling\/openwrt latest 4f4bc5dca2d9 3 hours ago 112MB<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u53ef\u89c1\uff0c\u955c\u50cf\u5df2\u6210\u529f\u62c9\u53d6\u5230\u672c\u5730\u3002<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"4-\u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668\">4.\u521b\u5efa\u5e76\u542f\u52a8\u5bb9\u5668<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker run &#8211;restart always &#8211;name openwrt -d &#8211;network macnet &#8211;privileged registry.cn-shanghai.aliyuncs.com\/suling\/openwrt:latest \/sbin\/init<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u5176\u4e2d\uff1a<\/p>\r\n\r\n\r\n\r\n<p><code>--restart always<\/code>\u53c2\u6570\u8868\u793a\u5bb9\u5668\u9000\u51fa\u65f6\u59cb\u7ec8\u91cd\u542f\uff0c\u4f7f\u670d\u52a1\u5c3d\u91cf\u4fdd\u6301\u59cb\u7ec8\u53ef\u7528\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>--name openwrt<\/code>\u53c2\u6570\u5b9a\u4e49\u4e86\u5bb9\u5668\u7684\u540d\u79f0\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>-d<\/code>\u53c2\u6570\u5b9a\u4e49\u4f7f\u5bb9\u5668\u8fd0\u884c\u5728 Daemon \u6a21\u5f0f\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>--network macnet<\/code>\u53c2\u6570\u5b9a\u4e49\u5c06\u5bb9\u5668\u52a0\u5165\u00a0<code>maxnet<\/code>\u7f51\u7edc\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>--privileged\u00a0<\/code>\u53c2\u6570\u5b9a\u4e49\u5bb9\u5668\u8fd0\u884c\u5728\u7279\u6743\u6a21\u5f0f\u4e0b\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>registry.cn-shanghai.aliyuncs.com\/suling\/openwrt:latest<\/code>\u4e3a Docker \u955c\u50cf\u540d\uff0c\u56e0\u5bb9\u5668\u6258\u7ba1\u5728\u963f\u91cc\u4e91 Docker \u955c\u50cf\u4ed3\u5e93\u5185\uff0c\u6240\u4ee5\u5728\u955c\u50cf\u540d\u4e2d\u542b\u6709\u963f\u91cc\u4e91\u4ed3\u5e93\u4fe1\u606f\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>\/sbin\/init<\/code>\u5b9a\u4e49\u5bb9\u5668\u542f\u52a8\u540e\u6267\u884c\u7684\u547d\u4ee4\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u542f\u52a8\u5bb9\u5668\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u00a0<code>docker ps -a<\/code>\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u7684\u5bb9\u5668\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>$ docker ps -a<br \/>CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES<br \/>a26cee7cade6 openwrt:latest &#8220;\/sbin\/init&#8221; 3 hours ago Up 3 hours openwrt<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u82e5\u5bb9\u5668\u8fd0\u884c\u4fe1\u606f<code>STATUS<\/code>\u5217\u4e3a\u00a0<code>UP<\/code>\u72b6\u6001\uff0c\u5219\u8bf4\u660e\u5bb9\u5668\u8fd0\u884c\u6b63\u5e38\u3002<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"5-\u8fdb\u5165\u5bb9\u5668\u5e76\u4fee\u6539\u76f8\u5173\u53c2\u6570\">5.\u8fdb\u5165\u5bb9\u5668\u5e76\u4fee\u6539\u76f8\u5173\u53c2\u6570<\/h3>\r\n\r\n\r\n\r\n<p><strong>(\u987b\u7ed3\u5408\u5b9e\u9645\u7f51\u7edc\u60c5\u51b5\uff0c\u4e0d\u80fd\u7167\u6284\u914d\u7f6e)<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>docker exec -it openwrt bash<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u5176\u4e2d\uff1a<\/p>\r\n\r\n\r\n\r\n<p><code>openwrt<\/code>\u4e3a\u5bb9\u5668\u540d\u79f0\uff1b<\/p>\r\n\r\n\r\n\r\n<p><code>bash<\/code>\u4e3a\u8fdb\u5165\u5bb9\u5668\u540e\u6267\u884c\u7684\u547d\u4ee4\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u6267\u884c\u6b64\u547d\u4ee4\u540e\u6211\u4eec\u4fbf\u8fdb\u5165 OpenWrt \u7684\u547d\u4ee4\u884c\u754c\u9762\uff0c\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u7f16\u8f91 OpenWrt \u7684\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>vim \/etc\/config\/network<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u6211\u4eec\u9700\u8981\u66f4\u6539 Lan \u53e3\u8bbe\u7f6e\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>config interface &#8216;lan&#8217;<br \/>option type &#8216;bridge&#8217;<br \/>option ifname &#8216;eth0&#8217;<br \/>option proto &#8216;static&#8217;<br \/>option ipaddr &#8216;192.168.123.100&#8217;<br \/>option netmask &#8216;255.255.255.0&#8217;<br \/>option ip6assign &#8217;60&#8217;<br \/>option gateway &#8216;192.168.123.1&#8217;<br \/>option broadcast &#8216;192.168.123.255&#8217;<br \/>option dns &#8216;192.168.123.1&#8217;<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u5176\u4e2d\uff1a<\/p>\r\n\r\n\r\n\r\n<p>\u6240\u6709\u7684\u00a0<code>192.168.123.x<\/code>\u00a0\u9700\u8981\u6839\u636e\u6811\u8393\u6d3e\u6240\u5904\u7f51\u6bb5\u4fee\u6539\uff0c<code>option gateway<\/code>\u548c<code>option dns<\/code>\u586b\u5199\u8def\u7531\u5668\u7684 IP\uff0c\u82e5\u6811\u8393\u6d3e\u83b7\u5f97\u7684 IP \u4e3a\u00a0<code>192.168.2.154<\/code>\uff0c\u8def\u7531\u5668 IP \u4e3a<code>192.168.2.1<\/code>\uff0c\u5219\u9700\u8981\u8fd9\u6837\u4fee\u6539\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>config interface &#8216;lan&#8217;<br \/>option type &#8216;bridge&#8217;<br \/>option ifname &#8216;eth0&#8217;<br \/>option proto &#8216;static&#8217;<br \/>option ipaddr &#8216;192.168.2.100&#8217;<br \/>option netmask &#8216;255.255.255.0&#8217;<br \/>option ip6assign &#8217;60&#8217;<br \/>option gateway &#8216;192.168.2.1&#8217;<br \/>option broadcast &#8216;192.168.2.255&#8217;<br \/>option dns &#8216;192.168.2.1&#8217;<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p><code>option ipaddr\u00a0<\/code>\u9879\u76ee\u5b9a\u4e49\u4e86 OpenWrt \u7684 IP \u5730\u5740\uff0c\u5728\u5b8c\u6210\u7f51\u6bb5\u8bbe\u7f6e\u540e\uff0cIP\u6700\u540e\u4e00\u6bb5\u53ef\u6839\u636e\u81ea\u5df1\u7684\u7231\u597d\u4fee\u6539\uff08\u524d\u63d0\u662f\u7b26\u5408\u89c4\u5219\u4e14\u4e0d\u548c\u73b0\u6709\u5df2\u5206\u914d IP \u51b2\u7a81\uff09\u3002<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"6-\u91cd\u542f\u7f51\u7edc\">6.\u91cd\u542f\u7f51\u7edc<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>\/etc\/init.d\/network restart<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"7-\u8fdb\u5165\u63a7\u5236\u9762\u677f\">7.\u8fdb\u5165\u63a7\u5236\u9762\u677f<\/h3>\r\n\r\n\r\n\r\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u7b2c 5 \u6b65<code>option ipaddr\u00a0<\/code>\u9879\u76ee\u4e2d\u7684 IP \u8fdb\u5165 Luci \u63a7\u5236\u9762\u677f\uff0c\u82e5<code>option ipaddr\u00a0<\/code>\u7684\u53c2\u6570\u4e3a\u00a0<code>192.168.123.100<\/code>\uff0c\u5219\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u8f93\u5165\u00a0<code>http:\/\/192.168.123.100<\/code>\u8fdb\u5165\u63a7\u5236\u9762\u677f\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u7528\u6237\u540d\uff1a<code>root<\/code><\/p>\r\n\r\n\r\n\r\n<p>\u5bc6\u7801\uff1a<code>password<\/code><\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"8-\u5173\u95ed-DHCP-\u670d\u52a1\">8.\u5173\u95ed DHCP \u670d\u52a1<\/h3>\r\n\r\n\r\n\r\n<p>\u5728 \u201c\u7f51\u7edc &#8211; \u63a5\u53e3 &#8211; Lan &#8211; \u4fee\u6539\u201d \u754c\u9762\u4e2d\uff0c\u52fe\u9009\u4e0b\u65b9\u7684 \u201c<strong>\u5ffd\u7565\u6b64\u63a5\u53e3\uff08\u4e0d\u5728\u6b64\u63a5\u53e3\u63d0\u4f9b DHCP \u670d\u52a1\uff09<\/strong>\u201d\uff0c\u5e76\u201c<strong>\u4fdd\u5b58&amp;\u5e94\u7528<\/strong>\u201d\u3002<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/6ed06-1570370001979.png\" alt=\"\u5173\u95ed \u201cDHCP \u670d\u52a1\u201d\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"9-\u4e3b\u8def\u7531-DHCP-\u8bbe\u7f6e\">9.\u4e3b\u8def\u7531 DHCP \u8bbe\u7f6e<\/h3>\r\n\r\n\r\n\r\n<p>\u8fdb\u5165\u8def\u7531\u5668\u540e\u53f0\u4e2d\uff0c\u5c06\u4e3b\u8def\u7531\u7684 DHCP \u7684\u9ed8\u8ba4\u7f51\u5173\u548c DNS \u670d\u52a1\u5668\u8bbe\u7f6e\u4e3a\u7b2c 5 \u6b65\u4e2d<code>option ipaddr\u00a0<\/code>\u9879\u76ee\u4e2d\u7684 IP\u3002<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/48ff0-1570370097838.png\" alt=\"\u4e3b\u8def\u7531 DHCP \u8bbe\u7f6e\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"10-\u91cd\u65b0\u8fde\u63a5\u8def\u7531\u5668\">10.\u91cd\u65b0\u8fde\u63a5\u8def\u7531\u5668<\/h3>\r\n\r\n\r\n\r\n<p>\u5b8c\u6210\u4ee5\u4e0a\u64cd\u4f5c\u540e\uff0c\u65ad\u5f00\u8bbe\u5907\uff08\u5982\u624b\u673a\uff0c\u7535\u8111\uff09\u4e0e\u8def\u7531\u5668\u7684\u8fde\u63a5\uff0c\u91cd\u65b0\u8fde\u63a5\u8def\u7531\u5668\uff0c\u8fde\u63a5\u8def\u7531\u5668\u7684\u8bbe\u5907\u5c06\u83b7\u53d6\u5230\u6211\u4eec\u8bbe\u7f6e\u5230\u7684 IP\u3002<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"\u5176\u4ed6\u4fee\u590d\">\u5176\u4ed6\u4fee\u590d<\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"1-\u5173\u95ed-WLAN-\u786c\u4ef6\u52a0\u901f\">1.\u5173\u95ed WLAN \u786c\u4ef6\u52a0\u901f<\/h3>\r\n\r\n\r\n\r\n<p>\u8bbe\u7f6e\u65c1\u8def\u8def\u7531\u540e\uff0c\u82e5\u51fa\u73b0\u8bbf\u95ee\u56fd\u5185\u7f51\u7ad9\u7f51\u901f\u6162\uff0c\u4e0d\u7a33\u5b9a\u7684\u60c5\u51b5\uff08\u591a\u89c1\u4e8e Pandavan \u53ca\u5176\u6539\u7248\u56fa\u4ef6\uff0c\u5982\u534e\u7855\u8001\u6bdb\u5b50\u56fa\u4ef6\uff09\uff0c\u8bf7\u5728\u8def\u7531\u5668\u7684\u63a7\u5236\u9762\u677f\u4e2d\u5173\u95ed\u6709\u5173 WLAN \u7684\u786c\u4ef6\u52a0\u901f\uff0c\u6bd4\u5982\u9009\u62e9\u201cOffload TCP\/UDP for LAN\u201d\uff08\u82e5\u672a\u51fa\u73b0\u6b64\u73b0\u8c61\u8bf7\u5ffd\u7565\uff09\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/2894d-1570370909461.png\" alt=\"\u5173\u95ed WLAN \u786c\u4ef6\u52a0\u901f\" \/><\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"2-\u5bbf\u4e3b\u673a\u7f51\u7edc\u4fee\u590d\">2.\u5bbf\u4e3b\u673a\u7f51\u7edc\u4fee\u590d<\/h3>\r\n\r\n\r\n\r\n<p>OpenWrt \u5bb9\u5668\u8fd0\u884c\u540e\uff0c\u5bbf\u4e3b\u673a\u5185\u53ef\u80fd\u65e0\u6cd5\u6b63\u5e38\u8fde\u63a5\u5916\u90e8\u7f51\u7edc\uff0c\u9700\u8981\u4fee\u6539\u5bbf\u4e3b\u673a\u7684\u00a0<code>\/etc\/network\/interfaces<\/code>\u00a0\u6587\u4ef6\u4ee5\u4fee\u590d\uff1a<\/p>\r\n\r\n\r\n\r\n<p><strong>(\u987b\u7ed3\u5408\u5b9e\u9645\u7f51\u7edc\u60c5\u51b5\uff0c\u4e0d\u80fd\u7167\u6284\u914d\u7f6e)<\/strong><\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>cp \/etc\/network\/interfaces \/etc\/network\/interfaces.bak # \u5907\u4efd\u6587\u4ef6<br \/>vim \/etc\/network\/interfaces # \u4f7f\u7528 vim \u7f16\u8f91\u6587\u4ef6<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u4ee5\u201c\u6811\u8393\u6d3e\u7231\u597d\u8005\u57fa\u5730\u201d64 \u4f4d Debian \u4e3a\u4f8b\uff0c\u5411\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>auto eth0<br \/>iface eth0 inet manual<br \/><br \/>auto macvlan<br \/>iface macvlan inet static<br \/>address 192.168.123.200<br \/>netmask 255.255.255.0<br \/>gateway 192.168.123.1<br \/>dns-nameservers 192.168.123.1<br \/>pre-up ip link add macvlan link eth0 type macvlan mode bridge<br \/>post-down ip link del macvlan link eth0 type macvlan mode bridge<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u5176\u4e2d\uff0c\u6240\u6709\u7684\u00a0<code>192.168.123.x<\/code>\u90fd\u9700\u8981\u6309\u7167\u6811\u8393\u6d3e\u6240\u5904\u7f51\u6bb5\u66f4\u6539\uff0c<code>gateway<\/code>\u548c<code>dns-nameservers<\/code>\u586b\u5199\u8def\u7531\u5668\u7684 IP\uff0c\u82e5\u6811\u8393\u6d3e\u83b7\u5f97\u7684 IP \u4e3a\u00a0<code>192.168.2.154<\/code>\uff0c\u8def\u7531\u5668 IP \u4e3a<code>192.168.2.1<\/code>\uff0c\u5219\u9700\u8981\u8fd9\u6837\u4fee\u6539\uff1a<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td>auto eth0<br \/>iface eth0 inet manual<br \/><br \/>auto macvlan<br \/>iface macvlan inet static<br \/>address 192.168.2.200<br \/>netmask 255.255.255.0<br \/>gateway 192.168.2.1<br \/>dns-nameservers 192.168.2.1<br \/>pre-up ip link add macvlan link eth0 type macvlan mode bridge<br \/>post-down ip link del macvlan link eth0 type macvlan mode bridge<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>\u4fee\u6539\u540e\u91cd\u542f\u6811\u8393\u6d3e\uff0c\u4e4b\u540e\u6811\u8393\u6d3e\u7684\u5c40\u57df\u7f51 IP \u5730\u5740\u5c06\u4f1a\u56fa\u5b9a\u4e3a<code>\/etc\/network\/interfaces<\/code>\u6587\u4ef6\u4e2d<code>address<\/code>\u53c2\u6570\u4e2d\u7684\u5730\u5740\u3002<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\" id=\"3-\u624b\u52a8\u6307\u5b9a\u7f51\u5173\">3.\u624b\u52a8\u6307\u5b9a\u7f51\u5173<\/h3>\r\n\r\n\r\n\r\n<p>\u5982\u679c\u8def\u7531\u5668\u56fa\u4ef6\u4e0d\u652f\u6301\u81ea\u5b9a\u4e49 DHCP \u670d\u52a1\u7684\u7f51\u5173\u53ca DNS \u5730\u5740\uff08\u5e38\u89c1\u4e8e\u8def\u7531\u5668\u5b98\u65b9\u56fa\u4ef6\uff09\uff0c\u6216\u8005\u53ea\u5e0c\u671b\u5c40\u57df\u7f51\u4e0b\u7684\u4e2a\u522b\u8bbe\u5907\u63a5\u5165\u65c1\u8def\u7f51\u5173\u65f6\uff0c\u987b\u5728\u63a5\u5165\u8bbe\u5907\u4e0a\u505a\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"\u5b89\u5353\uff1a\">\u5b89\u5353\uff1a<\/h4>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/7341d-1570424885014.png\" alt=\"\u5b89\u5353\u8bbe\u7f6e\" \/><\/figure>\r\n\r\n\r\n\r\n<p>\u9700\u8981\u5728\u5b89\u5353\u7684 WIFI \u8bbe\u7f6e\u5185\u5c06 IP \u83b7\u53d6\u65b9\u5f0f\u66f4\u6539\u4e3a\u201c\u9759\u6001\u201d\u6216\u201c\u624b\u52a8\u201d\uff0c\u5176\u4e2d\uff1a<\/p>\r\n\r\n\r\n\r\n<p>\u201cIP \u5730\u5740\u201d\u9879\u76ee\u9700\u8981\u66f4\u6539\u4e3a\u7f51\u6bb5\u5185\u4e0d\u51b2\u7a81\u7684\u5730\u5740\uff1b<\/p>\r\n\r\n\r\n\r\n<p>\u201c\u7f51\u5173\u201d\u6216\u201c\u8def\u7531\u5668\u201d\u9879\u76ee\u9700\u8981\u66f4\u6539\u4e3a\u65c1\u8def\u7f51\u5173 IP \u5730\u5740\uff1b<\/p>\r\n\r\n\r\n\r\n<p>\u201c\u524d\u7f00\u957f\u5ea6\u201d\u9879\u76ee\u586b\u5199\u201c24\u201d\uff1b<\/p>\r\n\r\n\r\n\r\n<p>\u201cDNS\u201d\u9879\u76ee\u9700\u8981\u66f4\u6539\u4e3a\u65c1\u8def\u7f51\u5173 IP \u5730\u5740\uff08\u4e24\u4e2a DNS \u8f93\u5165\u6846\u586b\u5199\u4e00\u4e2a\u5c31\u53ef\u4ee5\uff09\u3002<\/p>\r\n\r\n\r\n\r\n<p>\u5b8c\u6210\u5e76\u63d0\u4ea4\u8bbe\u7f6e\u540e\uff0c\u5173\u95ed WIFI \u5f00\u5173\u518d\u6253\u5f00\uff0c\u8fde\u63a5\u8bbe\u7f6e\u7684 WIFI \u70ed\u70b9\uff0c\u82e5\u5f53\u524d\u7f51\u7edc\u53c2\u6570\u4e3a\u8bbe\u5b9a\u503c\uff0c\u5219\u8bc1\u660e\u8bbe\u7f6e\u6210\u529f\u3002<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"Windows\">Windows:<\/h4>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/4aa28-1570425536078.png\" alt=\"Windows \u8bbe\u7f6e\" \/><\/figure>\r\n\r\n\r\n\r\n<p>\u5728\u65e0\u7ebf\u70ed\u70b9\u7684\u201c\u5c5e\u6027\u201d\u754c\u9762\u4e0b\uff0c\u70b9\u51fb \u201cIP \u8bbe\u7f6e &#8211; \u7f16\u8f91\u201d\u6309\u94ae\uff0c\u5728\u5f39\u51fa\u6846\u4e2d\u66f4\u6539 IP \u5206\u914d\u6a21\u5f0f\u4e3a\u201c\u624b\u52a8\u201d\uff0c\u6253\u5f00 IPV4 \u7684\u5f00\u5173\uff0c\u6839\u636e\u6240\u5904\u7f51\u6bb5\u53ca\u4e0a\u6587\u5b89\u5353\u7684\u76f8\u5173\u8bbe\u7f6e\u586b\u5199\u76f8\u5173\u53c2\u6570\u5373\u53ef\u3002<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"\u6ce8\u610f\u4e8b\u9879\">\u6ce8\u610f\u4e8b\u9879<\/h2>\r\n\r\n\r\n\r\n<ol>\r\n<li><strong>\u6587\u7ae0\u6240\u8ff0\u65b9\u6848\u9002\u7528\u4e8e\u5149\u732b\u6216\u8def\u7531\u5668\u5df2\u5b8c\u6210\u5bbd\u5e26\u62e8\u53f7\u7684\u7f51\u7edc\u73af\u5883\uff0c\u672a\u6d4b\u8bd5\u4e5f\u4e0d\u63a8\u8350\u4f7f\u7528 Docker \u5185\u7684 OpenWrt \u8fdb\u884c\u5bbd\u5e26\u62e8\u53f7<\/strong>\uff1b<\/li>\r\n<li>OpenWrt \u5bb9\u5668\u8ddf\u968f\u6811\u8393\u6d3e\u7cfb\u7edf\u542f\u52a8\uff0c\u65e0\u9700\u624b\u52a8\u5e72\u9884\uff1b<\/li>\r\n<li>\u7531\u4e8e\u5bb9\u5668\u5185\u7cfb\u7edf\u5185\u6838\u5171\u4eab\u5bbf\u4e3b\u673a\u5185\u6838\uff0c\u6240\u4ee5\u5728 Luci \u9762\u677f\u7684 \u201c\u5185\u6838\u7248\u672c\u201d\u9879\u4e0e\u5bbf\u4e3b\u673a\u5185\u6838\u7248\u672c\u4e00\u81f4\uff1b<\/li>\r\n<li>\u5728\u5bf9\u5bb9\u5668\u8fdb\u884c\u505c\u6b62\u6216\u5220\u9664\u64cd\u4f5c\u65f6\uff0c\u6811\u8393\u6d3e\u53ef\u80fd\u4f1a\u53d1\u751f\u5361\u987f\u73b0\u8c61\uff0cSSH \u53ef\u80fd\u4f1a\u65ad\u5f00\uff0c1~2 \u5206\u949f\u540e\u4f1a\u6062\u590d\u6b63\u5e38\uff0c\u76ee\u524d\u539f\u56e0\u4e0d\u660e\uff1b<\/li>\r\n<li>\u7ecf\u6d4b\u8bd5\uff0c\u53d1\u73b0 Adblock \u4e0d\u5de5\u4f5c\uff0cUnblockNeteaseMusic \u9700\u8981\u81ea\u884c\u8bbe\u7f6e\u4ee3\u7406\uff0c\u9664\u6b64\u4e4b\u5916\u5bb9\u5668\u4e2d\u7684 OpenWrt \u591a\u6570\u5e94\u7528\u5de5\u4f5c\u6b63\u5e38\uff0c\u5982\u6709\u53d1\u73b0\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c\u7684\u5e94\u7528\u8bf7\u8bc4\u8bba\u53cd\u9988~<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"\u529f\u80fd\u5c55\u793a\">\u529f\u80fd\u5c55\u793a<\/h2>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/2f022-1570427399298.png\" alt=\"\u603b\u89c8\u9762\u677f\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/792d1-1570427504837.png\" alt=\"\u7cfb\u7edf\u8bbe\u7f6e\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/a7b5e-1570427438125.png\" alt=\"ShadowSocksR Plus+\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/953ae-1570427538310.png\" alt=\"Aria2\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/8eb8d-1570427568808.png\" alt=\"OPENVPN\u670d\u52a1\u5668\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/cfb7b-1570427605996.png\" alt=\"\u63a5\u53e3\u8bbe\u7f6e\" \/><\/figure>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.wjxy.net.cn\/wp-content\/uploads\/2020\/03\/8e5e4-1570427653385.png\" alt=\"\u5e26\u5bbd\u76d1\u63a7\" \/><\/figure>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\" id=\"\u53c2\u8003\u8d44\u6599\">\u53c2\u8003\u8d44\u6599<\/h2>\r\n\r\n\r\n\r\n<p>1.OpenWrt By Lean \u00b7 coolsnowwolf\/lede &#8211; GitHub<\/p>\r\n\r\n\r\n\r\n<p><a href=\"https:\/\/github.com\/coolsnowwolf\/lede\">https:\/\/github.com\/coolsnowwolf\/lede<\/a><\/p>\r\n\r\n\r\n\r\n<p>2.\u3010\u5c0f\u72ee\u5b50\u7f16\u8bd1\u8d34\u3011\u629b\u7816\u5f15\u7389\uff0c\u4e3a\u6253\u9020N1\u8def\u7531\u795e\u5668 &#8211; \u6069\u5c71\u65e0\u7ebf\u8bba\u575b<\/p>\r\n\r\n\r\n\r\n<p><a href=\"https:\/\/www.right.com.cn\/forum\/thread-588747-1-1.html\">https:\/\/www.right.com.cn\/forum\/thread-588747-1-1.html<\/a><\/p>\r\n\r\n\r\n\r\n<p>3.docker openwrt \u8e29\u5751\u7684\u51e0\u4e2a\u5c0f\u95ee\u9898\u89e3\u51b3\u8fc7\u7a0b\u5206\u4eab &#8211; \u6069\u5c71\u65e0\u7ebf\u8bba\u575b<\/p>\r\n\r\n\r\n\r\n<p><a href=\"https:\/\/www.right.com.cn\/forum\/thread-1048535-1-1.html\">https:\/\/www.right.com.cn\/forum\/thread-1048535-1-1.html<\/a><\/p>\r\n\r\n\r\n\r\n<p>4.N1\u5237\u5165LEAN OPENWRT\u505a\u65c1\u8def\u7f51\u5173\uff0c\u5bfc\u81f4\u8bbf\u95ee\u56fd\u5185\u7f51\u7ad9\u5361\u987f &#8211; \u6069\u5c71\u65e0\u7ebf\u8bba\u575b<\/p>\r\n\r\n\r\n\r\n<p><a href=\"https:\/\/www.right.com.cn\/forum\/thread-506510-1-1.html\">https:\/\/www.right.com.cn\/forum\/thread-506510-1-1.html<\/a><\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\uff1a https:\/\/mlapp.cn\/376.html docker run &#8211;restart alwa [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/582"}],"collection":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=582"}],"version-history":[{"count":12,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":2944,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=\/wp\/v2\/posts\/582\/revisions\/2944"}],"wp:attachment":[{"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjxy.net.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}