侧边栏壁纸
  • 累计撰写 33 篇文章
  • 累计创建 7 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

玩客云armbian 5.9的docker下装openwrt

Administrator
2025-01-22 / 0 评论 / 0 点赞 / 42 阅读 / 0 字 / 正在检测是否收录...

一、玩客云刷armbian5.9请参考以前发表的文章

https://www.xunidd.com/archives/wky-sj

二、装docker

1.更换源

修改/etc/apt/sources.list

deb https://mirrors.ustc.edu.cn/debianbuster main contrib non-free
deb https://mirrors.ustc.edu.cn/debianbuster-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debianbuster-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contribnon-free

Ctrl+O保存,Ctrl+X退出。
(ps,如果这步操作不好就用winscp或FinalShell,登陆后有文件管理功能可以像记事本一样改目录 /etc/apt/sources.list )

2.更新

apt-get update

3.使用docker安装脚本

apt install docker.io

4.装docker可视面板

docker run --restart always --name fast -p 8081:8081 -d -v /var/run/docker.sock:/var/run/docker.sock wangbinxingkong/fast

安装完成后在浏览器访问 http://服务器IP地址或域名:8081 。
首次登录需要注册,注册成功后即可正常使用。

三、装openwrt(ssh里面执行)

1.打开网卡混杂模式

ip link set eth0 promisc on

2.创建网络

docker network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 -o parent=eth0 macnet

[以上代码自己根据玩客云所在网段修改,如:玩客云IP:192.168.2.175,则192.168.1.0/24 改成 192.168.2.0/24,192.168.1.1改成主路由地址]

3.拉取 OpenWRT 镜像

docker pull xuanaimai/onecloud:21-09-15

4.创建容器

docker run -itd --name=OneCloud --restart=always --network=macnet --privileged=true xuanaimai/onecloud:21-09-15 /sbin/init

–name=OneCloud 其中OneCloud是容器名称,可以更改成你想要的,容器名称注意不要和其他容器一样,会冲突。

根据主路由DHCP分配里找到一个主机名叫 OpenWRT 的,复制它的IPv4 地址粘贴到浏览器就能进入 OpenWRT了
密码是 password

作为 单臂路由 时

🔸网络 → 接口 → LAN → 物理设置 → 桥接接口 的 √ 去掉

🔸防火墙 → 自定义规则 → [# iptables -t nat -A POSTROUTING -o pppoe-wan -j MASQUERADE] 前的 [# ] 去掉

🔘如果没有这条规则,请添加 iptables -t nat -A POSTROUTING -o pppoe-wan -j MASQUERADE

🔸如果有使用OpenClash,则 OpenClash → 全局设置 → 基本设置 → 绑定网络接口 选择 pppoe-wan

🔸打开 /etc/resolv.conf ,把 127.0.0.11 修改成 127.0.0.1

🔘此方法非永久,重启后恢复 127.0.0.11

🔘flippy大的方法,在 系统 → 启动项最下方的 本地启动脚本 添加

cat > /etc/resolv.conf <<EOF

search lan

nameserver 127.0.0.1

options ndots:0

EOF

0

评论区