{"id":225889,"date":"2020-12-13T10:34:02","date_gmt":"2020-12-13T02:34:02","guid":{"rendered":"http:\/\/4563.org\/?p=225889"},"modified":"2020-12-13T10:34:02","modified_gmt":"2020-12-13T02:34:02","slug":"%e5%8f%8b%e5%96%84-nanopi-r4s-docker-%e8%bf%90%e8%a1%8c%e8%87%aa%e7%bc%96%e8%af%91-openwrt","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=225889","title":{"rendered":"\u53cb\u5584 NanoPi R4S docker \u8fd0\u884c\u81ea\u7f16\u8bd1 openwrt"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u53cb\u5584 NanoPi R4S docker \u8fd0\u884c\u81ea\u7f16\u8bd1 openwrt               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : handsome198311 <\/span>  <span><i><\/i> 13<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\">                        \u524d\u51e0\u5929\u7684\u8d34\u5b50 https:\/\/www.v2ex.com\/t\/733930<br \/>\u7cfb\u7edf\u7ba1\u7406(atop htop sudo netdata) <br \/>\u7f16\u8bd1\u5668 gcc <br \/>\u5b57\u4f53(DejavaSans DejavaSansMono) <br \/>\u9a71\u52a8(\u65e0\u7ebf rtl8812au \u7f51\u5361 usb \u7f51\u5361 asix-ax88179) <br \/>ffmpeg mjpg-streamer<br \/>\u7f51\u7edc\u90e8\u5206 openldap-server\uff0c (openconnect,wireguard strongswan tinc zerotier n2n softethervpn)\uff0c\u5de5\u5177 iperf iperf3 mtr\uff0c\u65e0\u7ebf\u652f\u6301 hostapd wpa-supplicant<br \/>utilities \u5168\u529f\u80fd vim shell (bash fish zsh) sqlite3 postgres-cli blue \u84dd\u7259 shadowutilities lsof lscpu whereis dmesg dbus file \u7b49\u7b49<br \/>luci-app \u90e8\u5206\u9664\u5f00 lean \u7684 \u52a0\u4e86 adguard home oled(\u5df2\u7ecf\u7f16\u8bd1\u4e86 i2c \u53ef\u4ee5\u63a5 oled \u5c0f\u5c4f\u663e\u793a\u9891\u7387\uff0c\u6e29\u5ea6\u548c ip) dockerman \u6ca1\u52a0\u5165\u7684 cifs sfe \u3002<\/p>\n<p>\u8fd9\u662f 14 \u53f7\u7f16\u8bd1\u7684\u56fa\u4ef6 https:\/\/mega.nz\/file\/YVtU0DrB#3oX1v94I4QTvjoAzdSK-18m1isPKjE2RmEpqhxSd3dY<\/p>\n<p>14 \u53f7\u7f16\u8bd1\u540e\u9009\u4e86 gz \u5305\uff0c\u5c31\u662f\u8981\u5728 docker \u4e2d\u8fd0\u884c\u7684 openwrt<br \/>\u8fd9\u662f\u53ef\u4ee5\u5bfc\u5165 docker \u7684\u5305 https:\/\/mega.nz\/file\/4YtElBhJ#xTEdGI0GYxyfMzEVpXYGoABXoDY-sxNgMCMw57-ra1o<\/p>\n<p>1 \u53bb\u5b98\u65b9\u4e0b\u8f7d\u56fa\u4ef6 \u6211\u4e0b\u8f7d\u7684\u662f rk3399-sd-friendlycore-focal-4.19-arm64-20201027.img \u73b0\u5728\u5b98\u65b9\u7684\u56fa\u4ef6\u9664\u4e86 friendwrt \u4e4b\u5916\u90fd\u662f 4.x \u7684\u5185\u6838\uff0c\u6211\u5df2\u7ecf\u8fd0\u884c\u4e86\u81ea\u7f16\u7684 5.4.x \u7684\u5185\u6838\u5728 docker \u4e0a \u4e0b\u8f7d\u4e4b\u540e\u70e7\u5165 sd \u542f\u52a8\u7cfb\u7edf\uff0c\u66f4\u65b0\uff0c\u5b89\u88c5 docker \u8bbe\u7f6e\u597d\u4e4b\u540e\u5c31\u53ef\u4ee5\u8fdb\u884c docker \u8fd0\u884c openwrt \u4e86<\/p>\n<p>\u6211\u505a\u4e8c\u7ea7\u8def\u7531 \u4e00\u4e2a\u7f51\u53e3\u5728 docker \u91cc\u505a WAN \u8bbe\u7f6e\u4e3a dhcp \u4e00\u4e2a\u505a LAN \u8bbe\u7f6e static <br \/>\u4e0b\u8f7d\u7f16\u8bd1\u7684 openwrt-rockchip-rk3399-default-rootfs.tar.gz scp \u4e0a\u4f20\u5230 R4S <br \/>\u6253\u5f00\u7f51\u5361\u6df7\u4e71\u6a21\u5f0f \uff08\u770b\u522b\u4eba\u7684\uff0c\u4e0d\u77e5\u9053\u662f\u4e0d\u662f\u5fc5\u987b\uff0c\u56e0\u4e3a\u6211\u662f\u505a\u4e8c\u7ea7\u8def\u7531\u8fd0\u884c\uff0c\u522b\u4eba\u7684\u662f\u5bbf\u4e3b\u673a\u8981\u5171\u4eab docker \u7684\u7f51\u7edc\uff09<br \/>ip link set eth0 promisc on<br \/>ip link set eth1 promisc on<\/p>\n<p>docker \u521b\u5efa\u7f51\u7edc\u63a5\u53e3 <br \/>docker network create -d macvlan &#8211;subnet=192.168.100.0\/24 &#8211;gateway=192.168.100.1 -o parent=eth1 -o macvlan_mode=bridge openwrt-WAN<br \/>\u8fd9\u91cc\u505a\u4e3a WAN \u8ddf\u6211\u7684\u4e0a\u7ea7\u8def\u7531\u540c\u7f51\u6bb5 \u7f51\u5173\u5c31\u662f\u4e0a\u7ea7\u8def\u7531 IP<\/p>\n<p>docker network create -d macvlan &#8211;subnet=192.168.7.0\/24 &#8211;gateway=192.168.7.1 -o parent=eth0 -o macvlan_mode=bridge openwrt-LAN<br \/>\u8fd9\u662f LAN \u7f51\u6bb5<\/p>\n<p>\u5bfc\u5165\u955c\u50cf<br \/>docker import openwrt-rockchip-rk3399-default-rootfs.tar.gz openwrt-r4s<br \/>\u521b\u5efa\u5bb9\u5668 <br \/>docker run -it -d &#8211;restart always &#8211;network openwrt-LAN &#8211;privileged &#8211;name openwrt openwrt-r4s \/sbin\/init<\/p>\n<p>\u8fdb\u5165\u5bb9\u5668 \u7136\u540e\u4fee\u6539 \/etc\/config\/network<\/p>\n<p>docker exec -it openwrt \/bin\/bash<\/p>\n<p>\u628a lan \u7684 ip \u6539\u4e3a\u4e0a\u9762\u521b\u5efa LAN \u7684 gateway \u540e \/etc\/init.d\/network restart \u5e94\u8be5\u53ef\u4ee5\u5728 r4s \u7684 LAN \u63a5\u5165\u7f51\u7ebf\u5728\u6d4f\u89c8\u5668\u91cc\u6253\u5f00 openwrt \u7684\u9875\u9762\u4e86\uff0c\u6211\u7684\u63a5 R4S \u7684 LAN \u7f51\u53e3\u4e3a\u624b\u52a8\u8bbe\u7f6e\u7684\u9759\u6001 ip<\/p>\n<p>\u5bbf\u4e3b\u673a\u548c docker \u4e4b\u95f4\u7684\u7f51\u7edc\u56e0\u4e3a\u662f macvlan \u7684\u6865\uff0c\u5b83\u4eec\u4e4b\u95f4\u662f\u4e0d\u901a\u7684\uff0c\u5982\u679c\u60f3\u8981\u5bbf\u4e3b\u673a\u5171\u4eab docker \u7684\u53ef\u4ee5\u81ea\u884c google<\/p>\n<p> \u4e1c\u839e\u5e95\u85aa 1720 \u5f88\u591a\u4eba\u53ef\u80fd\u4e0d\u660e\u767d\u5e95\u85aa\u662f\u4ec0\u4e48\u610f\u601d \u4e5f\u5c31\u662f\u8bf4\u6bcf\u6708\u5de5\u4f5c 22 \u5929\uff0c\u6bcf\u5929 8 \u5c0f\u65f6\uff0c\u5de5\u8d44\u662f 1720 \u3002\u5982\u679c\u7b97\u65f6\u85aa\u7684\u8bdd\u5c31\u662f\uff08 1720\/(22*8))=9.7\/\u5c0f\u65f6 \u8d85\u51fa\u8fd9\u4e2a\u5e73\u5e38\uff08\u5468\u4e00\u5230\u5468\u4e94\uff09\u7684\u52a0\u73ed\u8d39 1.5 \u500d \u5927\u6982 15\/\u5c0f\u65f6 \u5468\u516d\u5468\u65e5 2 \u500d <br \/>\u505a\u4e3a\u7535\u5b50\u5382\u6d41\u6c34\u7ebf\u4e00\u540d\u666e\u5de5\uff0c\u4e00\u4e2a\u6708 4000 \u5de6\u53f3\uff0c\u60f3\u60f3\u8981\u52a0\u591a\u5c11\u73ed \u3002\u7f16\u8bd1 openwrt \u56fa\u4ef6\u7eaf\u5c5e\u5174\u8da3\uff0c\u6b22\u8fce\u4ea4\u6d41\uff0c\u4e0d\u7528\u51b7\u5632\u70ed\u8bbd\uff0c\u663e\u793a\u4f60\u7684\u9ad8\u5927\u4e0a\u3002\u5728\u56fd\u5185\u505a\u9ed1\u4ea7\u7070\u4ea7\u7684\uff0c\u90fd TMD \u7684\u6709\u540e\u53f0\uff0c\u6709\u4e13\u4e1a\u516c\u53f8\u5728\u505a\uff0c\u5728\u8fd9\u4e2a\u9664\u5f00\u6cd5\u5f8b\u7ea6\u675f\u4eba\u4e0e\u4eba\u4e4b\u95f4\u7684\u4fe1\u4efb\u51e0\u4e4e\u4e3a\u96f6\u7684\u793e\u4f1a\u4e0b\uff0c\u4eba\u4e2a\u8d39\u65f6\u8d39\u529b\u6295\u6bd2\u7684\u8bdd\u6700\u540e\u90fd\u5f97\u997f\u6b7b\u4e86\u3002\u5341\u51e0\u5e74\u524d\u5f53\u5728\u7f51\u5427\u505a\u7f51\u7ba1\u90a3 pubwin \u660e\u7740\u5728\u6d4f\u89c8\u5668\u91cc\u63d2 javascript \u8ba9\u4f60\u7684\u641c\u7d22\u7ed3\u679c\u5357\u8f95\u5317\u8f99\uff0c\u7a7f\u900f\u8fd8\u539f\u8f6f\u4ef6\u7684\u75c5\u6bd2\u4e0d\u90fd\u662f 360 \u51e0\u4e2a\u516c\u53f8\u7684\u4eba\u641e\u51fa\u6765\u7684\u3002\u6240\u4ee5\u8bf4\uff0c\u9a6c\u4e91\u6562\u8bf4 996 \u662f\u798f\u62a5\uff0c\u771f\u4e86\u89e3\u60c5\u51b5\u7684\u3002\u4e0d\u626f\u86cb\u4e86\uff0c\u8001\u5b50\u8981\u4e0a\u73ed\u4e86\u3002      <\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>5<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4574387\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Illusionary <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u73a9\u610f\u592a\u8d35\uff0c\u8fd8\u4e0d\u5982 j1900                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4574388\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hadoop <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u73a9\u610f v2 \u80fd\u8dd1\u591a\u5c11\uff1f R2S \u53ea\u80fd 200M                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4574389\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : swiftg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Illusionary \u522b\u62b1\u7740 j1900 \u4e0d\u653e\u4e86\uff0c\u8fde aes \u90fd\u6ca1\u6709\u3002\u8fd9\u4e2a\u65e0\u8bba\u54ea\u65b9\u4fbf\u90fd\u6bd4 j1900 \u5f3a                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4574390\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : swiftg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u60f3\u8981\u4e2a openwrt \u5b98\u65b9 19.07.5 \u7684\u7eaf\u51c0\u56fa\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4574391\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : oko <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             1037U \u771f\u9999                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u53cb\u5584 NanoPi R4S doc&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/225889"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=225889"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/225889\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225889"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}