使用Docker部署openwrt软路由
前期准备 拉取 Docker image docker pull registry.cn-shanghai.aliyuncs.com/suling/openwrt:x86_64 注:这里的镜像 tag 为架构,这里是 x86_64,可以根据自己的架构选择镜像。 开启网卡混杂模式 sudo ip link set eth0 promisc on 这里的eth0修改为自己的网卡名称。 创建 Docker 网络 docker network create -d macvlan --subnet=192.168.0.0/24 --gateway=192.168.0.1 -o parent=eth0 macnet 同样的,这里的subnet修改为自己的网段,gateway修改为当前网络内的网关。 部署镜像 创建网络配置文件 vim /path/to/openwrt/network 配置文件如下: config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option packet_steering '1' config interface 'lan' option type 'bridge' option ifname 'eth0' option proto 'static' option ipaddr '192....