rv1126b内置phy接hub交换机芯片
板卡:RV1126b
hub交换机芯片:ip175g
phy:内置百兆phy
测试方法:将RK3576板俩个网口接到ip175g连接出来RJ45上
1、设备树phy配置
hub交换机芯片不需要做其他配置 ,该芯片为傻瓜式的 ,只需要保证内置phy是正常即可
&gmac { phy-mode = "rmii"; clock_in_out = "input"; phy-handle = <&rmii_phy>; status = "okay"; }; &mdio { rmii_phy: ethernet-phy@2 { compatible = "ethernet-phy-id0680.8101", "ethernet-phy-ieee802.3-c22"; reg = <2>; clocks = <&cru CLK_MACPHY>; clock-frequency = <50000000>; resets = <&cru SRST_RESETN_MACPHY>; pinctrl-names = "default"; pinctrl-0 = <&fephym1_pins>; phy-is-integrated; }; };
2、验证方法
2.1 修改netplan eth0配置静态IP
sudo vim /etc/netplan/xxxx.yaml network: version: 2 renderer: networkd ethernets: eth0: optional: true dhcp4: no dhcp4-overrides: route-metric: 100 addresses: - 192.168.10.1/24 nameservers: addresses: [8.8.8.8]
保存后重启复位 查看eth0 ip是否设置ip地址
sudo netplan apply

2.2 安装并配置 DHCP 服务
以轻量级的 dnsmasq 为例
安装dnsmasq,启动默认/etc/dnsmasq.conf ,这里不使用 建议kill掉。
apt install dnsmasq
需要确保配置网关与前面静态ip保持一致
vim dnsmasq-eth.conf
# 监听 eth0 接口 interface=eth0 # 绑定到该接口,避免影响其他接口 bind-interfaces # 为下游设备分配的 IP 范围,租期为 12 小时 dhcp-range=192.168.10.50,192.168.10.200,12h # 告知下游设备它们的网关地址是我们的 eth0 IP dhcp-option=3,192.168.10.1 # 告知下游设备 DNS 服务器地址(可以使用网关地址,也可以使用公共 DNS) dhcp-option=6,8.8.8.8
启动监听eth0
dnsmasq -i eth0 -C dnsmasq-eth.conf

这里将rk3576俩个网口接打rv1126b上 ,可以看到rk3576网口能自动获取到ip ,并且能正常ping通

原文地址: http://www.cveoy.top/t/topic/qGIy 著作权归作者所有。请勿转载和采集!