找出外部设备的IP地址


1

我有一个外部设备(PCB板条箱),我不知道IP地址。连接到该设备的是广播其MAC地址的PCB。最终,我想知道这个MAC地址。

我可以用以太网电缆连接到PCB板条箱。我的PC上有两个以太网卡,一个连接到外部世界(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地址。我不知道这是不是一个问题。我尝试分配IP4地址

ifconfig eth1 192.168.0.10 netmask 255.255.255.0

但我没有看到这个地址分配给eth1。而且,我不知道PCB箱子有什么IP地址,所以我不知道如何与它沟通。

如何确定PCB板箱的IP地址?如何与之通信,以便将PCB的MAC地址广播到我的以太网卡?


我猜这是Linux。是否ip addr显示正确分配的地址?ifconfig遗憾的是Linux 已经过时了。
grawity

1
在插入电线并且wireshark正在运行时,您是否对电源箱进行了电源循环?在启动时,通常当设备尝试和他们谈话时。
保罗

@grawity我添加了输出ip addr
pfnuesel

@Paul是的,我试图在wireshark运行的同时重启循环箱。我根本没有输出。
pfnuesel

1
也许您有为该接口运行的dhcp服务?
保罗
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.