How to detect the presence of network devices without assigning an IP address

1

I want to be able to detect if a certain device with a given MAC address is on the network, without requiring that the testing device's interface has an IP address at all. One way I could do it is by sending a DHCP discovery packet and checking the MAC address of the DHCP server, although this is limited to discovering the DHCP server only. I also looked up protocols like LLDP, but it seems like that requires a daemon running on the device being probed to respond to the messages.

I have used arping in the past to use ARP messages (so layer 2 only) to 'ping' an IP address, but this still requires an IP address assigned to the interface. I need some kind of l2ping, which pings a MAC address and sees if it gets a response.

Xenopathic

Posted 2014-07-31T21:23:16.800

Reputation: 746

Answers

1

It looks like arping can test if a host is ARP-reachable without requiring the interface to have an IP address. The only downside is that you need to know the destination host's IP address in the first place, but this is fine for my uses since any host that is being tested in this way has a static IP address anyway.

With the version of arping in iputils, the following command works:

arping -D -I <iface> <addr>

Obviously the network interface needs to have a link (ip link set <iface> up) but it doesn't need an IP address.

Xenopathic

Posted 2014-07-31T21:23:16.800

Reputation: 746

0

If it doesn't have an IP it's not on your network, so you can't reach it.

All you can do is limit the access to the network itself by setting a MAC whitelist that grants permissions(classic hotspot way).

AFAIK, obviously.

phaberest

Posted 2014-07-31T21:23:16.800

Reputation: 101