跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
Mcuzone Wiki
搜索
搜索
登录
个人工具
登录
查看“0009 MP2.5GD(Dual 2.5G ETH)”的源代码
页面
讨论
大陆简体
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
←
0009 MP2.5GD(Dual 2.5G ETH)
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[0009 MP2.5GD(双2.5G以太网)|切换语言为中文]] == '''Keywords''' == Raspberry Pi 5, PCIe, Switch, RL8125, 2.5Gbps, Ethernet, iperf3 Ethernet Speed Test == '''I. Introduction''' == The Raspberry Pi 5 is equipped with a 16-pin PCIe interface, through which we can attach various PCIe devices. This time, we expand the PCIe interface into two PCIe ports using a PCIe Switch chip, and then through two RTL8125 chips, we achieve dual 2.5Gbps Ethernet expansion. The expansion board is driver-free under the Raspberry Pi OS and is automatically recognized as eth1 and eth2 upon power-up. If using Ubuntu system, the RTL8125 driver needs to be installed first in order to use the board. == '''II. Hardware Spec''' == 1. Use a 0.5mm 16-pin PCIe cable to connect to the PCIe interface on the Raspberry Pi 5. 2. Using a PCIe Switch chip to expand one PCIe port into two, extending to two RTL8125 2.5Gbps Ethernet ports. 3. The RTL8125 2.5G Ethernet adapter is driver-free in the official Raspberry Pi OS and OpenWrt systems, but requires driver installation in Ubuntu systems. 4. The onboard 2.54-2p auxiliary power supply interface can be used to provide additional power if there is insufficient power when both 2.5G Ethernet ports are operating at full load simultaneously. 5.Gold immersion PCB process, lead-free production, certified by UL, compliant with ROHS standards, and has a fire rating of 94V-0. 6. The board has four M2.5 mounting holes, with a recessed design on the top of the board to facilitate the use of the 40-Pin GPIO. == '''III. Software Spec''' == === 3.1Overview === This document uses the Raspberry Pi OS, Ubuntu system and OpenWrt system for testing. 1)The version of the Raspberry Pi OS is: 2024-07-04-raspios-bookworm-arm64.img.xz You can download the Raspberry Pi OS in: <nowiki>https://www.raspberrypi.com/software/operating-systems/#raspberry-pi-os-64-bit</nowiki> 2)The version of the Ubuntu system is: ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz You can download the Ubuntu system in: <nowiki>https://ubuntu.com/download/raspberry-pi</nowiki> 3)The version of the OpenWrt system is: openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz === 3.2 System flashed onto the SD (TF) card === [[0005 MPS2242 2280 2280P(Single SSD Expansion Board)#3.2 Boot from TF card|Click here to read the instructions for System flashing]] == '''IV. Work with Raspberry Pi OS''' == === 4.1 4.1 Internet test === The 2.5G Ethernet ports on the MP2.5GD expansion board are plug-and-play without requiring drivers under Raspberry Pi OS. Once the system is up, excute the command <code>ifconfig -a</code> in the Raspberry Pi terminal, and the 2.5G Ethernet ports will be recognized as eth1 and eth2: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_04.jpg Open https://www.speedtest.cn/ on the PC to test speed. The speed test results for the 2.5G Ethernet ports connected to the Internet (200M broadband) are as follows: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_39.jpg http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_40.jpg '''''Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.''''' === 4.2 2.5G intranet test === Install the network speed testing tool iperf3: <code>sudo apt install iperf3</code> http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_04.jpg Use iperf3 to perform speed tests between the Raspberry Pi OS and the PC through a 2.5G router. '''''4.2.1 The speed test results for eth1 are as follows:''''' When Raspberry Pi OS acts as a client, the speed is about 2.02 Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_07.jpg When Raspberry Pi OS acts as a server, the speed is about 1.84 Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_08.jpg '''''4.2.2 The speed test results for eth2 are as follows:''''' When Raspberry Pi OS acts as a client, the speed is about 2.01 Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_09.jpg When Raspberry Pi OS acts as a server, the speed is about 1.84 Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_10.jpg '''''Note: The speed test can be affected by the network environment and the testing method. Speeds should be considered based on actual results; this test is for reference only.''''' === 4.3 Fix the MAC address of the 2.5G Ethernet port === The 2.5G Ethernet port uses the RTL8125 network card, and during use, the MAC address is not fixed. Each time the device is powered on again, the MAC address changes randomly. The following explains how to set a fixed MAC address for the RTL8125 network card. This explanation also applies to the Ubuntu system. First, check the identification information of the RTL8125 network card in terminal: <code>ipconfig -a</code> http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_46.jpg Here, two RTL8125 network cards are identified as eth1 and eth2, but in practice, the names recognized by the system might be different. Then input: <code>sudo mousepad /etc/systemd/system/macspoof@eth1.service</code> Or: <code>sudo nano /etc/systemd/system/macspoof@eth1.service</code> eth1 is the name recognized by the system for the network card shown above. Executing the above command will create a new document, then enter the following text: [<code>Unit]</code> <code>Description=MAC Address Change %I</code> <code>Wants=network-pre.target</code> <code>Before=network-pre.target</code> <code>BindsTo=sys-subsystem-net-devices-%i.device</code> <code>After=sys-subsystem-net-devices-%i.device</code> <code>[Service]</code> <code>Type=oneshot</code> <code>ExecStart=/usr/bin/ip link set dev %i address xx:xx:xx:xx:xx:xx</code> <code>ExecStart=/usr/bin/ip link set dev %i up</code> <code>[Install]</code> <code>WantedBy=multi-user.target</code> Here, "xx:xx:xx:xx:xx:xx" represents the MAC address you wish to assign. You can determine it according to the MAC address format (make sure it does not duplicate the MAC address of other network devices). After setting it, save and exit. Then execute the following command to enable the service: <code>sudo systemctl enable macspoof@eth1.service</code> This completes the fixation of the MAC address for eth1. For other network interfaces such as eth2, follow the same steps as described above. After completing all operations, restart the system. Once the system has finished rebooting, execute <code>ipconfig -a</code> to see that the MAC address has been successfully changed: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_47.jpg == '''五、Ubuntu系统下使用演示''' == === 5.1 安装Ubuntu系统下RTL8125驱动 === MP2.5GD扩展板上的2.5G网口在Ubuntu系统下不能即插即用,需要安装RTL8125驱动。 因为树莓派5的无线网卡模块在Ubuntu系统下是即插即用的,所以我们需要使用无线网卡连接无线网络: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_11.jpg 也可以使用网线连接树莓派5上的原生网口。 Ubuntu系统默认不安装ifconfig工具,所以需要手动安装: <code>sudo apt install net-tools</code> http://www.mcuzone.com/wiki/0008_MPS2_5G/0008_MPS2_5G_13.jpg 输入<code>ifconfig -a</code>,可见此时并没有显示2.5G网卡: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_12.jpg 接下来我们开始安装RTL8125驱动。 首先需要更新系统: <code>sudo apt-get update</code> http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_13.jpg 接着准备编译环境: <code>sudo apt-get install --reinstall linux-headers-$(uname -r) linux-headers-generic build-essential dkms</code> http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_14.jpg 然后安装驱动: <code>sudo apt-get install r8125-dkms</code> 按提示安装即可: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_15.jpg 安装完成后输入: <code>sudo modprobe r8125</code> http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_16.jpg 输入<code>ifconfig -a</code>就可以看到两个enxxx的网卡接口,这样就安装完毕2.5G网卡驱动: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_17.jpg === 5.2 Internet网络测试 === 对两个网口分别连外网(200M宽带)测速,结果如下: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_18.jpg http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_19.jpg '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。''''' 如果使用Ubuntu内置的Firefox浏览器时运行速度很慢或者经常无响应,建议安装轻量浏览器Falkon: <code>sudo apt install falkon</code> === 5.3 2.5G内网测试 === 安装网络测速软件iperf3: <code>sudo apt install iperf3</code> http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_20.jpg 利用iperf3,在Ubuntu系统与PC之间进行测速。 '''''enp3s0测速结果如下''''': 当Ubuntu系统作为client时,速度大约为2.34Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_21.jpg 当Ubuntu系统作为server时,速度大约为1.83Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_22.jpg '''''enp4s0测速结果如下:''''' 当Ubuntu系统作为client时,速度大约为2.35Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_23.jpg 当Ubuntu系统作为server时,速度大约为1.83Gbps: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_24.jpg '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。''''' == '''六、OpenWrt系统操作演示''' == === 6.1 概述 === MP2.5GD扩展板在OpenWrt系统下,扩展板上的'''两个2.5G网口可以作为LAN口''',树莓派5上的'''原生千兆网口可以作为WAN口''',这样就能配置成一个双LAN口的2.5G路由器,同时接在LAN口上的设备之间的传输速度最高可达2.5Gbps。。 === 6.2 准备工作 === 本文档使用的OpenWrt系统为:openwrt-bcm27xx-bcm2712-rpi-5-squashfs-sysupgrade-linux-6.1.100-20240805.img.gz 烧写OpenWrt系统并上电启动后,我们将网线一端插在树莓派5的原生网口上,另一端插在PC上,待PC的网卡与树莓派5上的网口连接成功后,我们在Windows设置中找到网络和Internet,在以太网中打开连接的网络查看默认网关的IP地址,这个地址就是OpenWrt系统的后台配置页面地址,如图所示,本文测试的地址为192.168.198.1: http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_53.jpg 然后打开网页浏览器输入192.168.198.1进入OpenWrt系统。默认用户名为<code>root</code>,默认密码为<code>password</code>: http://www.mcuzone.com/wiki/2001_CM4_Ultra/2001_CM4_Ultra_54.jpg === 6.3 MP2.5D双LAN口的配置和应用 === 进入“系统 - TTYD终端”,输入ifconfig -a命令,可以看到有eth0、eth1、eth2三个网口,其中eth0为树莓派5的原生网口,eth1和eth2为扩展板的两个2.5G网口: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_25.jpg 点击“网络 - 接口”,点击“修改”: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_26.jpg 在“物理设置”中,把eth1和eth2(2.5G网口)选中,然后点击“保存&应用”按钮: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_27.jpg 将网线从树莓派5的原生网口中拔出,插入任意一个2.5G网口,待PC的网卡与2.5G网口连接成功后,我们刷新管理页面,点击“网络 - 接口”,点击“修改”: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_28.jpg 在“物理设置”中,把eth0前面的勾去掉,然后点击“保存”按钮: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_29.jpg 回到“网络 - 接口”,点击“添加新接口”: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_30.jpg 接口名称设置为WAN,接口协议选择DHCP客户端,接口选择eth0后点击“提交”按钮: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_31.jpg 在防火墙设置中选择WAN口后点击“保存&应用”按钮: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_32.jpg 把连接Internet网络的网线插到树莓派5的原生网口上,然后回到“网络 - 接口”,稍等片刻,就可以看见新建的WAN接口获取了IP地址,这样PC就可以通过此扩展板上网了: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_33.jpg 测速(200M宽带)结果如下: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_38.jpg 把两台具有2.5G网卡的PC(本文档为了区分,两台PC所使用的系统,一台Windows系统,一台Ubuntu系统,用户可以根据自己的需求使用适合的系统)分别接到eth1和eth2上,利用iperf3测速,结果如下: http://www.mcuzone.com/wiki/0009_MP2_5GD/0009_MP2_5GD_43.jpg 实测Windows作为client端,Ubuntu作为server端,速度约为1.68Gbps;Windows作为server端,Ubuntu作为client端,速度约为2.17Gbps。 '''''注意:网络测速受网络环境和测试方法影响,速度请以实际为准,本测试仅供参考。''''' === 6.4 其它应用 === 树莓派5的无线模块可以作为无线AP,也可以作为无线WAN口,关于这些应用的实现,请参考下列链接: [[0008 MPS2.5G(SSD和2.5G以太网)#6.4 树莓派自带WiFI做无线AP(master模式)使用|树莓派自带WiFI做无线AP(master模式)使用]] [[0008 MPS2.5G(SSD和2.5G以太网)#6.5 树莓派自带WiFi做Client使用|树莓派自带WiFi做Client使用]] {{联系我们_图标}}
本页使用的模板:
模板:Contact Us icon
(
查看源代码
)
返回
0009 MP2.5GD(Dual 2.5G ETH)
。
开关有限宽度模式