• 网站更换域名啦!烦请各位及时更新哦,旧域名将在一定时间后不可访问
  • 网站所有加密内容密码一律为:920.im;别问为什么,问就是为了活着
  • 现已回国安心恢复身体,感谢所有在闭站期间仍然支持我的人,从零开始,继续努力
  • 订阅小站 TG频道获取更多小福利
  • 欢迎访问小站,如果您觉得本站还不错,请Ctrl+D 收藏本站
  • 请不要催更视频或文章;网站+所有视频制作都是我一人再弄,而且懒;你们多多留言,我可能就会破天荒更新了
  • 任何虚假邮箱的留言评论将一律不通过,你的邮箱不会被公开,请放心留言交流
  • 网站今后如果无法访问,请自行使用代理访问

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

Tech CrazyJoe 8个月前 (03-08) 2267次浏览 4个评论
本文最后更新于2020年10月1日,已超过 26天没有更新,如果文章内容或资源失效,请留言反馈,谢谢!

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

Before We Start

In order to follow this guide, I assume you already have:

  1. A machine which is running Openwrt/LEDE in docker
  2. Already install the portainer to manage the docker image

I will use Phicomm N1 as an example.

Backup Your Setting

Login to your Openwrt dashboard and select backup/flash firmware under the system section. Make a backup of your current setting.

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

Upload Your Local Image

Use SCP or FTP tool to upload your local image to your N1 /root folder

Import and Config Openwrt

Use following command to import the image to the docker

docker import [your file name] openwrt:[your own tag]

ip link set eth0 promisc on

## X equals to your main router gateway (if your main router is 192.168.123.1, then X=123)

docker network create -d macvlan --subnet=192.168.X.0/24 --gateway=192.168.x.1 -o parent=eth0 macnet

docker run --restart always -d --network macnet --privileged openwrt:[your own tag] /sbin/init

Login to your portainer control panel and choose Local—containers

Delete your old OpenWrt image(you will lose internet connection temporarily), then select fourth option  on the new OpenWrt image and choose connect

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

vi /etc/config/network

## Keyboard input i to enable edit
## Change the third number to your main router gateway
## Save and Exit
## Keyboard input ESC to exit edit
:wq

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

Restart your OpenWrt image and it’s done


中文教程由此开始

开始之前

为了跟随此教程,我默认你已经有了

  1. 一台Docker运行OpenWrt/LEDE固件的机器
  2. 已经安装portainer用于管理Docker镜像文件

在此教程中,我使用斐讯N1作为旁路由为例

备份设置

登录你现在的OpenWrt固件后台,并在系统选项下选择备份/更新,备份现有设置

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

上传本地镜像

利用SCP或者FTP工具上传本地的镜像文件到N1的/root目录下

导入并设置OpenWrt

用以下命令将本地镜像导入Docker

docker import [your file name] openwrt:[your own tag]

ip link set eth0 promisc on

## X 等于你主路由的网段 (例如你的主路由地址是 192.168.123.1, 那么X=123)

docker network create -d macvlan --subnet=192.168.X.0/24 --gateway=192.168.x.1 -o parent=eth0 macnet

docker run --restart always -d --network macnet --privileged openwrt:[your own tag] /sbin/init

登录你的portainer后台并选择容器

删除你之前的OpenWrt镜像(你会暂时失去网络连接),并在新导入的镜像上选择第四项,并连接

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

vi /etc/config/network

## 键盘输入 i 开启编辑
## 将以下栏目的第三个数字改为你的主路由网段地址
## 保存并退出
## 键盘输入ESC退出编辑模式
:wq

How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件

重启OpenWrt镜像完成配置

Video Tutorial | 视频教程

Youtube

Bilibili

0 0 vote
Article Rating

xzの小站 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:How to Import Local OpenWrt/LEDE Image into Docker | 如何Docker本地导入升级Openwrt路由器固件
喜欢 (9)
关于作者:
Is life always this hard, or is it just when you're a kid?——Mathilda:Léon: The Professional
Subscribe
Notify of
4 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
4
0
Would love your thoughts, please comment.x
()
x