{"id":2093,"date":"2023-11-23T10:07:06","date_gmt":"2023-11-23T02:07:06","guid":{"rendered":"https:\/\/www.yusian.com\/blog\/?p=2093"},"modified":"2023-11-23T10:07:06","modified_gmt":"2023-11-23T02:07:06","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8docker%e4%b8%ad%e5%88%9b%e5%bb%baopenwrt%e5%ae%b9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/article\/2023\/11\/23\/1007062093.html","title":{"rendered":"\u5982\u4f55\u5728Docker\u4e2d\u521b\u5efaOpenWrt\u5bb9\u5668"},"content":{"rendered":"<h3>\u5173\u952e\u6b65\u9aa4<\/h3>\n<ul>\n<li>\u4e0b\u8f7d Image <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/hub.docker.com\/r\/openwrt\/rootfs\">https:\/\/hub.docker.com\/r\/openwrt\/rootfs<\/a><\/li>\n<li>\u521b\u5efa\u5bb9\u5668<\/li>\n<\/ul>\n<pre><code class=\"language-shell line-numbers\">docker run -it --privileged --network net-19.1 --ip 172.19.1.249 --name openwrt -v \/home\/ubuntu\/.config\/openwrt:\/etc\/config openwrt\/rootfs:x86-64-v23.05.2 \/sbin\/init\n<\/code><\/pre>\n<ul>\n<li>\u4fee\u6539\/etc\/config\/network \u914d\u7f6e<\/li>\n<\/ul>\n<pre><code class=\"language-conf line-numbers\">config interface 'loopback'\n    option device 'lo'\n    option proto 'static'\n    option ipaddr '127.0.0.1'\n    option netmask '255.0.0.0'\n#\nconfig interface 'lan'\n    option device 'eth0'\n    option proto 'static'\n    option ipaddr '172.19.1.249'\n    option netmask '255.255.255.0'\n    option ip6assign '60'\n<\/code><\/pre>\n<h3>\u91cd\u8981\u8bf4\u660e<\/h3>\n<ul>\n<li>\u6839\u636e\u5e73\u53f0\u627e\u5230\u5bf9\u5e94\u7684\u955c\u50cf\u6587\u4ef6\uff0c\u5982\u679c\u662fLinux 64\u4f4d\u73af\u5883 \uff0c\u53ef\u4ee5\u76f4\u63a5latest<\/li>\n<li>Docker\u4e2d\u521b\u5efa\u65b0\u7684\u6865\u63a5\u7f51\u7edc\uff0c\u65b9\u4fbf\u7ed9OpenWrt\u6307\u5b9a\u56fa\u5b9aip\u5730\u5740<\/li>\n<li>\u7531\u4e8eOpenWrt\u9ed8\u8ba4\u63a5\u53e3\u5730\u5740\u662f192.168.1.1\uff0c\u6240\u4ee5\u9700\u8981\u8fdb\u5165\u5bb9\u5668\u4e2d\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4f7f\u4e4b\u4e0e\u5206\u914d\u7684ip\u4e00\u81f4<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How to create an openwrt container on Docker.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[386,1],"tags":[346,8,23],"class_list":["post-2093","post","type-post","status-publish","format-standard","hentry","category-ubuntu","category-article","tag-docker","tag-linux","tag-openwrt"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=2093"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2093\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=2093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=2093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=2093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}