盒子信息:S905L、1G+4G、百兆网口、USB2.0x2、2.4G WiFi(Armbian下未驱动)、无蓝牙
自带安卓系统终端下输入:
cat /proc/device-tree/amlogic-dt-id
得到结果:
gxl_211_1g
一、U盘烧录
使用镜像:
Armbian_5.77_Aml-s905_Ubuntu_bionic_default_5.0.2_20190401.img
修改烧录好的U盘boot分区下的uEnv.ini文件中的dtb_name值为
/dtb/meson-gxl-s905x-nexbox-a95x.dtb
二、U盘启动Armbian
U盘插靠近网口的USB口
HDMI接显示器+外接键盘 or TTL串口。显示器或终端窗口出现Login字样时,输入用户名root登录,初始密码1234。提示修改密码,再次输入初始密码1234,接着输两次新密码完成密码修改。提示创建新用户按CTRL+C取消,用新密码重新登录
三、Armbian配置
终端输入
armbian-config
System > SSH 配置SSH
Personal > Timezone 修改时区为Asia > Shanghai
修复DNS
ln -fs /run/resolvconf/resolv.conf /etc/resolv.conf
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main restricted universe multiverse
四、安装docker
更新container.io(出国更快)
可到https://download.docker.com/linux/debian/dists/buster/pool/stable/arm64查看历史版本和最新版本(下方1.4.3-1即版本号)
curl -O https://download.docker.com/linux/debian/dists/buster/pool/stable/arm64/containerd.io_1.4.3-1_arm64.deb
dpkg -i ./containerd.io_1.4.3-1_arm64.deb
官方apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://get.docker.com -o get-docker.sh | sh get-docker.sh --mirror Aliyun
国内加速
curl -sSL https://get.daocloud.io/docker | sh
docker镜像源
Docker中国区官方镜像:
https://registry.docker-cn.com
网易:
http://hub-mirror.c.163.com
ustc:
https://docker.mirrors.ustc.edu.cn
中国科技大学:
https://docker.mirrors.ustc.edu.cn
vim /etc/docker/daemon.json
写入以下内容
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
保存重启Docker服务
systemctl daemon-reload
systemctl restart docker.service
安装portainer
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
五、Docker安装OpenWRT做旁路由
拉取镜像
docker pull unifreq/openwrt-aarch64
开启网卡混杂模式
ip link set eth0 promisc on
创建虚拟网络(子网和网关根据自己网络修改)
docker network create -d macvlan --subnet=192.168.123.0/24 --gateway=192.168.123.1 -o parent=eth0 macnet
创建openwrt容器
docker run --name openwrt --restart always -d --network macnet --privileged unifreq/openwrt-aarch64
进入openwrt容器
docker exec -it openwrt bash
修改IP(将option ipaddr后面的192.168.1.1替换为你想登录OpenWRT的IP地址,与主路由同网段)
vi /etc/config/network
重启网络
/etc/init.d/network restart
浏览器输入刚修改的IP,登录OpenWRT
LAN接口关闭DHCP,网关填写主路由IP,DNS可以为主路由IP或114等公共DNS。
在防火墙添加规则:
iptables -t nat -I POSTROUTING -j MASQUERADE
并重启防火墙
六、其他设置
修改盒子Armbian /etc/network/interfaces文件
auto eth0
iface eth0 inet manual
up ip link set eth0 promisc on
auto macvlan
iface macvlan inet static
address 192.168.123.243 #为盒子指定IP,根据实际情况修改
netmask 255.255.255.0
gateway 192.168.123.1 #网关,根据实际情况修改(主路由或旁路由IP)
dns-nameservers 192.168.123.1 114.114.114.114 #DNS,一个主路由IP(或旁路由IP),一个公共DNS
hwaddress ether XX:XX:XX:XX:XX:XX #指定MAC地址,防止MAC地址来回变
pre-up ip link add macvlan link eth0 type macvlan mode bridge
post-down ip link del macvlan link eth0 type macvlan mode bridge
永久开启网卡混杂模式
ifconfig eth0 promisc
重启Armbian
鸣谢&参考:
N1刷Armbian系统并在Docker中安装OpenWrt旁路由的详细教程_engineerlzk的专栏-CSDN博客_docker安装openwrt