-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Programmatically determine the local address CIDR #5
Comments
There is a way to get this from OctoPrint's API, using the test utilities I believe. See https://docs.octoprint.org/en/master/api/util.html#post--api-util-test, although I haven't tried it and it sounds specific to the client IP, not a general one. Still, provides the subnet things that might be interesting. I just haven't found time to implement it. |
My intention is to idiot proof this process as much as possible. If the local network can be determined automagically, then the user doesn't have to understand the concept or the process for determining it themselves and it removes all those places along the path where they could make a mistake (typo). From the docs you pointed me to, it sounds like the "Tests whether a provided address (or, if none is provided, the client’s remote address) is a LAN address and if so returns the subnet specifier in CIDR format" is exactly what is needed (and probably better than my complex bash command since it should be OS agnostic. |
Gina added it to 1.5.0 for this use case (since she new I was creating the plugin). I'll see if I can find a bit of time to look at this one over the next couple of weeks, shouldn't take too long. |
Is that reliable in cases a host has "complex" network configuration? For example, multiple interfaces, alias interfaces, bridges, or the like? |
(note that I am by no means an expert and have never touched anything close to a complex network) The test address API tests the connecting client IP, and returns out 3 things:
Implementation can be found here: I want to say it should do, however without testing it I'm hesitant to do so as I don't know the specifics of your network. |
Is your feature request related to a problem? Please describe.
In an attempt to make this as easy as possible, the plugin should (on OctoPi or Linux) programmatically determine the current local address CIDR.
Describe the solution you'd like
PreFill the Local Network entries with the programmatically determined values. The text
If you have a different local address range than what's listed here, get in touch with whoever administrates your network to find out the local IP range. This will be what you put where it says 'Local Networks' below.
might need some different wording.Describe alternatives you've considered
None
Additional context
On OctoPi (or another Linux distribution) you can use the following command:
ip route | grep -P 'eth0|wlan0' | awk '{print $1}'
or for IPV6:
ip -6 route | grep -P 'eth0|wlan0' | awk '{print $1}'
The text was updated successfully, but these errors were encountered: