juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
23.58k stars 1.3k forks source link

[Feature] Allow to lookup Node by its Tailnet IP address in GRPC API #2237

Open jirutka opened 1 week ago

jirutka commented 1 week ago

Use case

For monitoring purposes, it’s necessary to find out to which node and user a given IP address belongs.

Description

.

Contribution

How can it be implemented?

a. Change GetNodeRequest to oneof node_id or tailnet_ip. If tailnet_ip is provided, lookup Node by its IPv4 or IPv6 address. b. Add a new method, e.g. GetNodeByIp.

kradalby commented 5 days ago

Sounds reasonable to me, maybe make it reasonable generic and tap into the "list" version so we can do id, name, ip etc?