树莓派软路由 OpenWrt 简介

用树莓派 DIY 软路由的时候,总会说到 OpenWrt 这个开源 Linux 发行版。那 OpenWrt 到底是什么,为什么会用于树莓派软路由?这篇文章将会解答关于 OpenWrt 的一系列问题。

OpenWrt 是什么

OpenWrt 是一个面向嵌入式设备的 Linux 操作系统,常用于小型无线路由器。

The OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned.

Cisco/Linksys(思科) 在 2003 年发布了 WRT54G 这款无线路由器,同年有人发现它的操作系统是基于Linux的,然而 Linux 是基于GPL许可证发布的,按照该许可证 Cisco 应该把 WRT54G 的源代码公开。2003年3月,Cisco 迫于公众压力公开了 WRT54G 的源代码。此后就有了一些基于 Cisco 源码的第三方路由器固件,OpenWrt 就是其中的一个。

2004年1月,OpenWrt 项目启动。第一版的 OpenWrt 基于 Linksys GPL sources for WRT54G 开发,也是现在广泛使用的版本。

2005年,OpenWrt 发布实验性版本,开始使用官方 GNU/Linux 的内核。

2007年,发布 White Russian(已不再维护)

2010年,发布 Backfire(已不再维护)。基于 Linux 2.6.32 long term support kernel, uClibc 0.9.30。

2013年,发布 Attitude Adjustment。基于 Linux Kernel 3.3, uClibc 0.9.33.2,支持 bcm2708 (Raspberry Pi) 平台。

OpenWrt 在树莓派上的应用

OpenWrt 天生服务于嵌入式无线路由器,而且 2013 年发布的 Attitude Adjustment 版本还官方支持了树莓派平台,所以用 OpenWrt 打造树莓派软路由变成一件很酷又相对简单的事情。

在官方的支持列表中,找到树莓派,下载相应的系统镜像,就可以开始软路由 DIY 之旅了。

或者直达 OpenWrt 的 raspberry pi 专题页面:https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi

软路由性能

在树莓派 3B 以及以前的硬件版本中,OpenWrt 软路由性能并不是特别理想:

  • USB 和 LAN 口共享带宽,造成网络传输瓶颈(USB 用于无线网卡,LAN 用于以太网)
  • CPU 计算性能不高

但2019年发布的树莓派 4B 已经不存在上述问题了:板载千兆以太网卡、2.4/5 GHz 802.11b/g/n/ac 无线网卡,USB 和 LAN 口各自独立,CPU 提速 4 倍,还能选配 4G RAM。

CPU 性能对比:

以太网卡速率对比:

无线网卡速率对比:

RAM 速率对比:

参考资料

  • OpenWrt Version History
  • About the OpenWrt/LEDE project
  • 经典回顾 54M无线霸主Linksys WRT54G评测
  • Raspberry Pi 4 released – Hardware Questions and Recommendations – OpenWrt Forum Raspberry Pi 4 specs and benchmarks — The MagPi magazine

  • 网站:https://hardcore-rpi.biko.pub/
  • 知乎专栏:https://zhuanlan.zhihu.com/hardcore-rpi
  • GitHub: https://github.com/hardcore-rpi

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容