具有多个eth接口的Raspberry Pi 4都有另一个ip

问题描述 投票:0回答:0

场景是我有两个 Raspi 4 靶心。第一个 Raspi 通过 eth0 接口连接到交换机。第二个 Raspi 通过 eth0 接口和两个 USB/ETH 接口 eth1 和 eth2 连接到同一个交换机。 我希望 Raspi2 的每个 eth 接口都有不同的 IP 地址。例如 eth0->192.169.1.20,eth1->.21 和 eth2->.22 .

现在我尝试从 Raspi1 ping 所有三个 ip 地址。我的问题是我能够通过 eth0 接口 ping 每个 ip 地址,而另一个接口都不起作用。但我希望每个 ip 地址通过接口物理分离。

我在 /etc/dhcpcd.conf 中设置配置

interface eth0
static ip_address=192.168.1.20

interface eth1
static ip_address=192.168.1.21

interface eth2
static ip_address=192.168.1.22

我也试过“通知”,但那也没用。

ifconfig 显示我:

eth0: flags 4099 <UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.1.20 netmask 255:255:255:0 broadcast 192.168.1.255
        ether e4:5f:01:75:4e:97 txqueuelen 100 (Ethernet)

eth1: flags 4163 <UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.1.21 netmask 255:255:255:0 broadcast 192.168.1.255
        ether 00:e0:4c:13:57:e4 txqueuelen 100 (Ethernet)

eth2: flags 4163 <UP,BROADCAST,MULTICAST> mtu 1500
        inet 192.168.1.23 netmask 255:255:255:0 broadcast 192.168.1.255
        ether ec:ad:e0:21:06:be txqueuelen 100 (Ethernet)

我跳过了inet6这行,因为我是手打的,没什么特别的... 我错过了一点吗?

ethernet raspberry-pi4 static-ip-address
© www.soinside.com 2019 - 2024. All rights reserved.