我有一个外部设备(PCB 板条箱),我不知道它的 IP 地址。连接到此设备的是广播其 MAC 地址的 PCB。最终,我想知道这个 MAC 地址。
我可以用以太网电缆连接到 PCB 机箱。我的电脑上有两张以太网卡,一张连接到外界(eth0
),一张连接到 PCB 机箱(eth1
)。
我安装了 wireshark 来查看是否有任何流量eth1
,但我什么也没看到。我怀疑我没有正确设置eth1
以太网卡。以下是ifconfig
告诉我的信息:
eth0 Link encap:Ethernet HWaddr 00:22:4D:AA:E6:1D
inet addr:128.141.223.194 Bcast:128.141.223.255 Mask:255.255.255.0
inet6 addr: fe80::222:4dff:feaa:e61d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1039531 errors:0 dropped:0 overruns:0 frame:0
TX packets:342830 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:339291866 (323.5 MiB) TX bytes:150976185 (143.9 MiB)
Interrupt:20 Memory:f7d00000-f7d20000
eth1 Link encap:Ethernet HWaddr 68:05:CA:26:B7:6F
inet6 addr: fe80::6a05:caff:fe26:b76f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:9228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:3190800 (3.0 MiB)
Interrupt:18 Memory:f7cc0000-f7ce0000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1076 errors:0 dropped:0 overruns:0 frame:0
TX packets:1076 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:96520 (94.2 KiB) TX bytes:96520 (94.2 KiB)
以下是 的输出ip addr
:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:22:4d:aa:e6:1d brd ff:ff:ff:ff:ff:ff
inet 128.141.223.194/24 brd 128.141.223.255 scope global eth0
inet6 fe80::222:4dff:feaa:e61d/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 68:05:ca:26:b7:6f brd ff:ff:ff:ff:ff:ff
inet6 fe80::6a05:caff:fe26:b76f/64 scope link
valid_lft forever preferred_lft forever
4: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noqueue state DOWN
link/ether 52:54:00:bb:7f:ae brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
link/ether 52:54:00:bb:7f:ae brd ff:ff:ff:ff:ff:ff
我看到eth1
有一个 IP6 地址,但没有 IP4 地址。我不知道这是否是个问题。我尝试使用
ifconfig eth1 192.168.0.10 netmask 255.255.255.0
但我没有看到分配给的这个地址eth1
。此外,我不知道 PCB 板条箱的 IP 地址是多少,所以我不知道如何与它通信。
我如何才能知道 PCB 板条箱的 IP 地址是多少?我如何与它通信,以便将 PCB 的 MAC 地址广播到我的以太网卡?