Skip to content

lsnet 0.14.0

Choose a tag to compare

@sanford sanford released this 10 Oct 06:25
· 9 commits to main since this release

SNMP

Every device found is now asked to describe itself over SNMP. Printers, managed switches, UPSes and some NAS answer with a description, the name their admin gave them and their maker, and a printer with its model too, which is often the only place it says it: Brother HL-L2350DW series rather than its network card's name.

A printer, a switch, a UPS or a NAS is called that on SNMP's word. A description like Linux nas 5.10 names only the kernel, so it's shown in the details and decides nothing. The details have an SNMP section, and --json has snmp.

The questions are SNMPv1 with the community public, the read-only default wherever SNMP is switched on. Devices set up with another community, or with SNMPv3 alone, don't answer. On a network whose monitoring would mind the questions, --no-snmp leaves them out.

IPv6 addresses

lsnet still lists devices by their IPv4 address, and now adds each one's link-local IPv6 address (fe80::...) where it can find it: in the details as IPv6, in --json as ipv6, and /fe80 filters for it.

One ping to the all-nodes address reaches every device on the link, and most answer: Macs, iPhones, Linux and much that's built on it. Bonjour gives the addresses of whatever advertises over it. An answer is matched to a device by MAC address, so without MACs only Bonjour's are shown.

  • An address made from a MAC, like fe80::211:32ff:fe66:d871, gives a device its MAC and vendor when nothing else did.
  • A link-local address reaches a device whatever its IPv4 address, including one flagged off-subnet or link-local. Say which interface it's on: ssh admin@fe80::211:32ff:fe66:d871%en0.
  • With sudo, when the whole network was scanned, anything that answered over IPv6 and isn't one of the devices listed is named under the results.
  • The ping isn't sent on Windows, or on Linux when net.ipv4.ping_group_range leaves you out. There, only Bonjour's addresses are shown.

This machine's services

The services view (2, or -s) now lists the machine running lsnet with the rest, when its servers answer at its network address. One listening only on localhost isn't on the network, so it isn't listed.

--ports: look for ports of your own

lsnet -s --ports 2049,5900        # NFS and VNC
lsnet -s -p 8200-8210 -p 9000     # a range, and the option given twice

The ports are tried on every device found, not on every address, so they cost little, and each one open is listed by its number. It takes up to 1,000 ports. Past that it's a port scan, and nmap is the tool.

Upgrading from 0.13.0

  • A scan now sends two SNMP questions to each device it finds, and one IPv6 ping to all of them. It takes no longer. --no-snmp leaves out the first.
  • The services view and lsnet -s can gain rows for this machine.
  • Some devices gain a model, a MAC or a vendor they didn't have, and a printer, switch or UPS that had no type may get one.
  • --json gains ipv6 and snmp, and mdns gains ipv6; all only appear when there's something to say. Nothing was removed or renamed, and printed tables haven't changed.
  • scripts/anonymize.py now makes over link-local IPv6 addresses too, since they can carry a MAC.

Download

  • macOS (Apple silicon): brew install sanford/tap/lsnet, or download lsnet-macos-arm64.tar.gz below (signed and notarized)
  • Windows: scoop install sanford/lsnet, or download lsnet-windows-x64.zip below
  • Anywhere with Rust: cargo install lsnet

Full changes: v0.13.0...v0.14.0