Cuong Manh Le
f9a3f4c045
Implement new flow for LAN and private PTR resolution
...
- Use client info table.
- If no sufficient data, use gateway/os/defined local upstreams.
- If no data is returned, use remote upstream
2023-11-30 18:28:51 +07:00
Cuong Manh Le
9e6e647ff8
Use discover_ptr_endpoints for PTR resolver
2023-11-27 22:19:16 +07:00
Cuong Manh Le
180eae60f2
all: allowing config defined discover ptr endpoints
...
The default gateway is usually the DNS server in normal home network
setup for most users. However, there's case that it is not, causing
discover ptr failed.
This commit add discover_ptr_endpoints config parameter, so users can
define what DNS nameservers will be used.
2023-11-16 20:57:52 +07:00
Cuong Manh Le
63f959c951
all: spoof loopback ranges in client info
...
Sending them are useless, so using RFC1918 address instead.
2023-11-06 20:01:57 +07:00
Cuong Manh Le
58a00ea24a
all: implement reload command
...
This commit adds reload command to ctrld for re-fetch new config from
ContorlD API or re-read the current config on disk.
2023-11-06 20:01:03 +07:00
Cuong Manh Le
6e28517454
all: generalize vpn client info
...
VPN clients often have empty MAC address, because they come from virtual
network interface. However, there's other setup/devices also create
virtual interface, but is not VPN.
Changing source of those clients to empty to prevent confustion in
clients list command output.
2023-10-04 16:34:47 +07:00
Cuong Manh Le
0f3e8c7ada
all: include client IP if ctrld is dnsmasq upstream
...
So ctrld can record the raw/original client IP instead of looking up
from MAC to IP, which may not the right choice in some network setup
like using wireguard/vpn on Merlin router.
2023-09-22 18:40:25 +07:00
Cuong Manh Le
82e44b01af
Add hosts file as source for hostname resolver
2023-09-22 18:29:37 +07:00
Cuong Manh Le
e5389ffecb
internal/clientinfo: use all possible source IP for listing clients
2023-08-09 23:57:20 +07:00
Cuong Manh Le
6e27f877ff
internal/clientinfo: use ptr cache when listing clients
2023-08-09 23:55:29 +07:00
Cuong Manh Le
39a2cab051
internal/clientinfo: only do self discover with client id
...
While at it, also ensure that client info table was initialized before
doing any lookup.
2023-08-09 23:55:13 +07:00
Cuong Manh Le
19bc44a7f3
all: prevent data race when accessing zerolog.Logger
2023-08-09 23:54:23 +07:00
Cuong Manh Le
437fb1b16d
all: add clients list command to debug Mac discovery
2023-08-09 23:54:23 +07:00
Cuong Manh Le
2cd8b7e021
internal/clientinfo: remove dhcp from refresher list
...
dhcp lease files are watched separately using fsnotify, it does not need
to be in refresher list.
2023-08-09 23:54:23 +07:00
Cuong Manh Le
d6768c4c39
internal/clientinfo: use default route IP as self client info
2023-08-09 23:54:23 +07:00
Cuong Manh Le
59a895bfe2
internal/clientinfo: improving mdns discovery
...
- Prevent duplicated log message.
- Distinguish in case of create/update hostname.
- Stop probing if network is unreachable or invalid.
2023-08-09 23:54:23 +07:00
Cuong Manh Le
cacd957594
internal/clientinfo: do not lower case hostname
2023-08-09 23:54:23 +07:00
Cuong Manh Le
76d2e2c226
Improving Mac discovery
2023-08-09 23:54:23 +07:00
Cuong Manh Le
9fe6af684f
all: watch lease files if send client info enabled
...
So users who run ctrld in Linux can still see clients info, even though
it's not an router platform that ctrld supports.
2023-08-09 23:54:23 +07:00