我正在使用树莓派3B和树莓派Buster.我将它连接到Wifi,它工作正常,没有任何问题。我想启用接口eth0,以便将我的Raspbi与Profinet (一种工业协议)一起使用。因此,我修改了文件/etc/dhcpcd.conf/:
但是"ifconfig“的输出是:
并且“路由-v”的输出是:route
我希望接口"eth0“的ip地址是静态的,并且显示出来,而且还能够被pinged到。我在像this one这样的论坛上尝试了很多东西:修改/etc/network/interface文件。但这并不管用。我还用"sudo ifconfig eth0 ipadress netmask 255.255.255.0 up“设置了eth0接口。妈妈的wifi在这之后崩溃了。有人能帮帮我吗?我已经坚持了几个星期了。非常感谢。如果你有任何问题,我可以提供一些截图。
干杯
发布于 2021-05-12 14:10:29
由于Raspbian Stretch而不是/etc/network/interfaces
,所以使用了文件/etc/dhcpcd.conf
。
使用您选择的编辑器编辑/etc/dhcpcd.conf
,向下滚动到示例配置,如下面的mi Pi3B+所示,取消注释各行,并根据需要配置参数。
# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=xxxx:xxxx:xxxx:xxxx::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 xxxx:xxxx:xxxx:xxxx::1
发布于 2021-05-12 17:38:36
更新/etc/dhcpcd.conf
interface eth0
static ip_address=192.168.0.10/24
重新启动dhcp服务
sudo service dhcpcd restart
并且,如果您希望路由器不将此ip分配给另一个材料,请不要忘记通知您的路由器dhcp租约,这将避免不稳定。
发布于 2021-05-18 12:09:46
还调用ethtool eth0
作为输出:
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Port: MII
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
Cannot get wake-on-lan settings: Operation not permitted
Current message level: 0x00000007 (7)
drv probe link
Link detected: no
这里有一些关于我的问题的更多细节。我将非常感谢你的帮助
https://stackoverflow.com/questions/67504709
复制相似问题