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
Fixes #29384 - Connect by IP: Prefer IPv6 over IPv4 #577
Conversation
3cb25fb
to
24c0661
Compare
Is this safe? Interfaces often have more than 1 ipv6 address, but foreman doesn't model this well (or at all to be precise) so just a single one of them is stored. I don't know from the top of my head how the address-to-be-stored is picked from all the addresses, but it is quite possible it will be a link-local address or something that can't really be used to reach the host. |
Hi @adamruzicka |
I thought we just use whatever facter (in case of puppet) gives us, which returns link local addresses if there are no other ipv6 addresses on a given interface. But apparently there's some additional filtering going on somewhere because I don't see ll addresses in foreman. @ares Do you recall if there was something else that made us not implement connect by ip for ipv6? |
Well, this file: https://github.com/theforeman/foreman/blob/3347fa49d500964f0209122d8d36c920d1feafcc/app/models/host/base.rb |
I was actually solving the very same problem in provisioning and my approach is a host parameter: Just saying. |
I've been thinking and was wondering if it would make sense to do some sort of "TCP Ping" to check if the device can be reached on any of the IP addresses instead of just taking IPv6 as the preferred address? |
I would stay away from ping checks, from time to time desperately confused users come to us saying that the ping/echo ICMP/TCP checks in our DHCP workflow made some huge pain to them until they figured it out. |
I completely undestand your point and agree that this would indeed be an less then suboptimal solution. |
You could turn the setting into IPv4, IPv6 or no (three states). Plus a host parameter could do the trick on a per-host basis. |
Oh yes, I actually like that idea a lot! Will implement this accordingly. |
@UXabre any progress here? |
Hi @adamruzicka , no further progress yet, I'm kinda flooded at this point. My next window of opportunity is coming saturday, it's not a lot of work really, so sorry for the delay. |
Gentle reminder we'd still be interested in this :) |
Hi, so sorry for the huge delay, now I'm in my holidays I did find the time! |
55548d9
to
e8e0afa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be made a bit DRYer, but in general +1
0fefc4f
to
392a6aa
Compare
Allright, I've made a tiny adjustment to actually work as a preference setting, meaning, if IPv6 preference is enabled, it should try an IPv6 address, if none exists, it should fall back to IPv4; and vice versa if the IPv6 preference is disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works nicely, let's get this in
Thank you @UXabre ! |
No description provided.