1. 29
    1. 8

      Yeah, switches can be remarkably smart. Ethernet has a whole stack of protocols: it isn’t two layers, the OSI model is lying to you.

      Another way to get location data from Ethernet is configuring your switches to participate as middleboxes in DHCP, by adding physical port information to DHCP requests. I’ve used this to augment the logging on the DHCP server so that when there is trouble the problem device can be physically located. But you could also use it to allocate IP addresses based on the switch port the device is plugged into. There are a bunch of problems with this idea if access to your network is relaxed: your users will plug multiple devices into one port or configure VMs without NAT, etc.

      1. 6

        lldpd in Debian comes with both an lldpcli and lldpctl. Lldpd can also tell the switch who you are!

        1. 2

          I’ve always thought that LLDP is an under utilized protocol. It could be used for bootstrapping a lot of things. I will add that I think you can get some of this info via DHCP, but not nearly as much.