Local user detection apparently not looking for IPv6 [fixed in v1.399]
The KiwiSDR lets you bypass some user limits (like idle connect time) when you're on the local LAN. This is very nice. But sometimes I still get bounced, other times not.
I suspect the checks only look for local IPv4 addresses and I'm getting bounced when I happen to use IPv6. A lot of networks use IPv6 these days, even if you don't think you are, e.g., mDNS with link-local IPv6 addresses when routable prefixes are not available. (That's the reason for the link-local prefix -- so you can plug things together and have them work even on an isolated network with no DHCP server or external Internet router, like a point-to-point link.)
If this is the case, note that IPv6 requires -- and frequently uses -- more than one local subnet prefix so you have to check for them all. The link local subnet fe80::/16 is always present, and there may also be more than one globally-routable IPv6 prefix (I have two).
Thanks!
I suspect the checks only look for local IPv4 addresses and I'm getting bounced when I happen to use IPv6. A lot of networks use IPv6 these days, even if you don't think you are, e.g., mDNS with link-local IPv6 addresses when routable prefixes are not available. (That's the reason for the link-local prefix -- so you can plug things together and have them work even on an isolated network with no DHCP server or external Internet router, like a point-to-point link.)
If this is the case, note that IPv6 requires -- and frequently uses -- more than one local subnet prefix so you have to check for them all. The link local subnet fe80::/16 is always present, and there may also be more than one globally-routable IPv6 prefix (I have two).
Thanks!
Comments
E.G. Allow local IPv4 subnet + "pc1.something.local", "single.trusted.remote" as long as your PC is what that FQDN points to it assumes local.
I distrust IPv6 as it seems so "well you could do the address by X,Y,Z, but obviously that relies on your ISP having L,K,M enabled"
Obviously it opens more support and security issues but then that is v6 anyway (IMO).
Stu
With mDNS (multicast DNS, which is what the .local suffix refers to), you can even plug your computer directly into the KiwiSDR with a point-to-point link, open your browser, enter "kiwisdr.local" and have it work. Your PC and the KiwiSDR assign themselves link local addresses and your browser discovers the KiwiSDR with mDNS.
IPv4 does have something like this, the "self assigned" address block 169.254.0.0/16 that you may have seen when you're having local network trouble. mDNS can use it too. But the IPv6 link-local prefix is a cleaner solution to the problem as everyone always has an address in that block in addition to whatever prefixes are assigned by your ISPs (there can be several). IPv4 addresses in the 169.254.0.0/16 block are used only as a fallback because it's rare to have more than one IPv4 subnet active at a time.
For example, my KiwiSDR at home has the following addresses:
eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 88:3f:4a:9a:2d:08 brd ff:ff:ff:ff:ff:ff
inet 192.168.42.165/24 brd 192.168.42.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 2001:470:d:aa4:8a3f:4aff:fe9a:2d08/64 scope global mngtmpaddr dynamic
valid_lft 86091sec preferred_lft 14091sec
inet6 2605:e000:1c0e:43f7:8a3f:4aff:fe9a:2d08/64 scope global mngtmpaddr dynamic
valid_lft 86091sec preferred_lft 14091sec
inet6 fe80::8a3f:4aff:fe9a:2d08/64 scope link
valid_lft forever preferred_lft forever
The "inet" line is my local (non-routable) IPv4 address. The next two "inet6" lines are globally routable prefixes from my upstream ISPs, Spectrum cable (2605) and a Hurricane Electric tunnel (2001). The last "inet6" line is the link-local address.
With IPv6 I can talk directly to my KiwiSDR from the outside provided I have IPv6 connectivity without any NAT port forwarding kludges. I do have that set up too, but only for the web service. With IPv6 I can talk transparently to any port on the KiwiSDR, including the SSH port, with no special configuration. If I had more than one, I could address each one individually without having to assign a different port number to each one.
Phil
Two routines are relevant, net/net.c: find_local_IPs() and isLocal_if_ip(). They produce lots of debug prints that will appear in the admin log tab. The next time you have a local net login failure it would be instructive to take a screenshot of the log tab (scrolled to the two appropriate places described below). Most of these debug prints do _not_ also appear in syslog due to space/noise.
First, find_local_IPs() queries all the Linux network interfaces to collect all possible ipv4/6 addresses that might be required for subsequent local network matching when a admin/user connection is made. This appears at startup near the top of the log messages. Example: So at the end of all that we are left with two valid server private addresses: a regular ipv4 and an ipv6 link local, both on eth0.
Now when an incoming admin/user connection is made isLocal_if_ip() attempts to do a match of the remote ip against the list of server private addresses looking for a local network match (ipv4 is checked first, then ipv6). Example: Here an ipv4 remote of 192.168.1.3 matches (i.e. "isLocal_if_ip: TRUE IPv4/4_6") against the server ipv4 192.168.1.107/24.
If you are being improperly prompted for a password on a local network then it is possible there is a bug in the password checking code (which is also very complex because of the many user-requested features it must handle, e.g. time limits). There are debug prints beginning with "PWD" that would be interesting to see in this case.
Fri Jul 17 06:08:43 01:40:20.525 0123 [05] PWD isLocal_if_ip: FALSE IPv6 remote_ip 2605:e000:1c0e:43f7:d63d:7eff:fe5f:1e2e ip_client 2605:e000:1c0e:43f7:d63d:7eff:fe5f:1e2e ip_server[IPv6] 2605:e000:1c0e:43f7:8a3f:4aff:fe9a:2d08 nm /64
The IPv6 address ending in 2d08 is indeed my kiwisdr's own IPv6 address. The address ending in 1e2e is that of my Linux desktop from which I am connecting. The /64 prefix width is correct.
When I happen to come in with IPv4, everything works:
Fri Jul 31 05:20:46 14d:00:52:23.429 .12. [00] PWD isLocal_if_ip: TRUE IPv4/4_6 remote_ip 192.168.42.99 ip_client 192.168.42.99/0xc0a82a63 ip_server[IPv4] 192.168.42.165/0xc0a82aa5 nm /24 0xffffff00
Please restart your Kiwi and login locally as admin until you get the failure condition and then let me know here. Thanks.
The Kiwi code did not anticipate this kind of situation. And after some reading it seems to occur in other scenarios as well. So I'll have to amend the code to check for a local network match against more interface addresses.
Multihoming is a pretty basic feature of IPv6, and every host is required to implement it. Among other things, it makes automatic renumbering much easier than in IPv4. I.e., your ISP can change your prefix, and as long as they provide a changeover period during which both prefixes are valid, you often don't have to do anything at all to your own computers.