[原创] 2022 新年礼物,基于 OpenWRT 官方原版镜像制作斐讯 N1OpenWRT 镜像

2022-01-02 14:35:43 +08:00
 xiaoun001

网上 N1 定制镜像很多,一是别人做的,也许很好,但不是独一份定制。二是安装新功能软件非常困难。基于此,找到一种方法,一是省事,二是可在线升级。如果,你有这个需求,往下看。

基于 OpenWRT 官方原版镜像制作纯净斐讯 N1 OpenWRT 镜像(其它 arm 的也可以,具体支持什么,查工具在线说明,工具不是我做的,我是拿来主义,也没有那个能力和精力,好用就可以),可在线安装软件包。

=镜像制作=

1 、git clone https://github.com/shenzt68/mknop.git 目录结构下: common/ device/ gen_openwrt LICENSE openwrt/ openwrt-19.07.8-armvirt-64-root.ext4.gz out/ README.md

2 、wget https://downloads.openwrt.org/releases/19.07.8/targets/armvirt/64/openwrt-19.07.8-armvirt-64-root.ext4.gz 将 openwrt-19.07.8-armvirt-64-root.ext4.gz 拷贝到上面 openwrt 目录

3 、执行 ./gen_openwrt -d

4 、在 mknop/out/phicomm-n1 目录里找到镜像,我的是 22.01.01-124122-phicomm-n1-5.4.73-aarch64-openwrt-firmware.img

6 、以 win32diskimager 写入镜像到 U 盘。DD 也可以,坑点,挑 U 盘。

7 、插入斐讯 N1 ,如此一个单臂 OpenWRT 路由做好了。

==OpenWRT 设置,基于 MACVLAN 的多端口模拟==

8 、进入 WEB 界面,设置 网络-接口-LAN-编辑-物理设置-桥接接口那个勾要去掉。就是 ETH0 不能桥接。

9 、设置 LAN 上网参数,达到路由器不拨号用 LAN 的参数正常上网目的。 10 、系统–software–update lists 11 、安装 kmod-macvlan

12 、系统-启动项-本地脚本输入 #设置 Eth0 子网卡(基于 MACVLAN ),注意,坑点,在网络接口-物理设置出,要取消 为指定接口创建桥接。就是说这个接口不能桥接。 ip link add veth1@eth0 link eth0 type macvlan mode bridge ifconfig veth1@eth0 hw ether 00000c010001 ip link set veth1@eth0 up

ip link add veth2@eth0 link eth0 type macvlan mode bridge ifconfig veth2@eth0 hw ether 00000c010002 ip link set veth2@eth0 up

ip link add veth3@eth0 link eth0 type macvlan mode bridge ifconfig veth3@eth0 hw ether 00000c010003 ip link set veth3@eth0 up

ip link add veth4@eth0 link eth0 type macvlan mode bridge ifconfig veth4@eth0 hw ether 00000c010004 ip link set veth4@eth0 up

12 、断电,重启,系统多了 4 个虚拟接口。veth1@eth0 ,veth2@eth0 ,veth3@eth0 ,veth4@eth0. 13 、网络-接口–添加新接口,设置为 WAN 即可。

网络结构:傻瓜交换机,端口 1 接光猫,端口 2 接斐讯 N1 ,端口 3 接电脑。

性能怎么样?实际上跟双口没有啥区别。

2548 次点击
所在节点    宽带症候群
7 条回复
leon7777
2022-01-02 23:13:13 +08:00
写的很好,学习了,所以我选择 r2s[狗头]
tousfun
2022-01-03 08:50:44 +08:00
所以楼主有没有科学上网的插件推荐? paaswall ssr+ 的功能太少,openclash 性能又不行
xiaoun001
2022-01-05 00:07:15 +08:00
@919615766 我这个纯粹就是做个普通路由。至于科学上网,不妨再跑个 linux 容器,想怎么玩都行。

@leon7777 谢谢鼓励,纯粹分享。话说 macvlan 的性能真的高,等同于物理网卡。
zhaojiexz
2022-01-07 13:38:43 +08:00
这个方案,是不是也只能跑到 500M ? 如果是 1000M 网络,是跑不满的?
lzyliangzheyu
2022-01-11 13:01:15 +08:00
感谢楼主,回去试试
xiaoun001
2022-01-13 01:03:00 +08:00
@zhaojiexz 不清楚的,我的带宽就 200 兆。不过单臂路由并非就是对半开的关系。所谓 1000 兆,是指 tx1000 ,RX1000 ,总共是 2000 兆的。实际上和两个网卡并无本质的不同。
xiaoun001
2022-01-13 01:07:28 +08:00
@zhaojiexz 手点快啦,没写完。 实际上我理解 N1 的单臂,他的网速瓶颈很有可能是硬件本身,跟是不是单网卡应该木有太大关系,会不会是总线,CPU ,系统本身优化的原因?我的理解也不一定准确。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/825781

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX