本教程所使用环境 (debian 11 x86_64, root管理员, lan为eth0, ip段 10.0.0.x, 用于拨号的主路由IP:10.0.0.1 ,不要照抄命令,根据自己的实际情况做相应的调整)
打开网卡混杂模式
ip link set eth0 promisc on
创建网络
docker network create -d macvlan –subnet=192.168.2.0/24 –gateway=192.168.2.1 -o parent=eth0 openwrt
拉取镜像,创建并启动容器
docker run –restart always –name openwrt -d –network openwrt –privileged kiddin9/openwrt-nginx:x86_64 /sbin/init
进入容器
docker exec -it openwrt sh
修改openwrt后台登录IP
本固件默认后台10.0.0.1, 假如我要修改为192.168.2.2
sed -i ‘s/10.0.0.1/192.168.2.2/’ /etc/config/network && /etc/init.d/network restart
原文链接:https://blog.csdn.net/Flying_x/article/details/120853671?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522167586359916800184116638%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=167586359916800184116638&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-24-120853671-null-null.blog_rank_default&utm_term=%E9%BB%91%E7%BE%A4%E6%99%96%2C%E7%BE%A4%E6%99%96%2Cnas%2C%E8%9C%97%E7%89%9B%E6%98%9F%E9%99%85%2CDSM%EF%BC%8C%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F%2Cipv6%2C%E8%BF%9C%E7%A8%8B%E8%AE%BF%E9%97%AE%2Cwordpress%EF%BC%8C%E5%BB%BA%E7%AB%99%2C%E9%98%BF%E9%87%8C%E4%BA%91%2C%E8%85%BE%E8%AE%AF%E4%BA%91%2C%E5%9F%9F%E5%90%8D%2C%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%2C