IPv6 support for the proxmox builder.#319
Conversation
9d0a6c7 to
588c136
Compare
| continue | ||
| } | ||
| if addr.To4() == nil { | ||
| } else if addr.IsLinkLocalUnicast() || addr.IsMulticast() || addr.IsLoopback() { |
There was a problem hiding this comment.
can't this be replaced with !addr.IsGlobalUnicast()?
also add || addr.IsUnspecified()?
There was a problem hiding this comment.
Added || addr.IsUnspecified()
I don't think we should change this to !addr.IsGlobalUnicast() because this misses the ULA. We could change it to !addr.IsGlobalUnicast() && !addr.IsPrivate()? This would inlcude 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7 and all public IPs.
588c136 to
9881f1b
Compare
It first checks for a valid IPv6 or IPv4 and continues if it's not valid. After that it continues if the ip is part of linkLocalUnicat, Multicast or loopback. The first ip which doesn't match one of the following types will be returned as valid. no IPv4 or IPv6 at all SiteLocalUnicast: fec0::/10 multicast: ff00::/8 global Unicast ::/96 LinkLocalUnicat: fe80::/64 If the proxmox interface supports IPv4 and IPv6 the selected ip depends on the proxmox list sorting of the returned addresses. The first valid ip will be used which can change depending on the proxmox api. related to hashicorp#233 related to #10227 related to #10858 Signed-off-by: oromenahar <github@mkwg.de>
9881f1b to
3617e03
Compare
| // but Unique Local Addresses: fc00::/7 can be used as well for IPv6 setups. | ||
| // SiteLocalUnicast: fec0::/10 | ||
| // multicast: ff00::/8 | ||
| // LinkLocalUnicat: fe80::/64 |
There was a problem hiding this comment.
This changes the default communicator host selection from IPv4-only to the first usable IPv4 or IPv6 address. On dual-stack guests, that can silently switch existing builds to IPv6 if the guest agent reports it first. Can we preserve current behavior by preferring IPv4 and only falling back to IPv6 when no usable IPv4 exists?
| continue | ||
| } | ||
| if addr.To4() == nil { | ||
| } else if addr.IsLinkLocalUnicast() || addr.IsMulticast() || addr.IsLoopback() || addr.IsUnspecified() { |
There was a problem hiding this comment.
Can we add focused tests for the address selection behavior here? We should cover IPv4-only, IPv6-only, and dual-stack ordering so this change is pinned down before merge.
Hey folks,
I added support for IPv6 and IPv4 dual stack setups or IPv6 only setups. The commit messages explains a lot for that reason I just copy the message to the description. I hope I didn't miss anything necessary and the PR can be discussed and reviewed.
It first checks for a valid IPv6 or IPv4 and continues if it's not valid. After that it continues if the ip is part of linkLocalUnicat, Multicast or loopback. The first ip which doesn't match one of the following types will be returned as valid.
no IPv4 or IPv6 at all
SiteLocalUnicast: fec0::/10
multicast: ff00::/8
LinkLocalUnicat: fe80::/64
If the proxmox interface supports IPv4 and IPv6 the selected ip depends on the proxmox list sorting of the returned addresses. The first valid ip will be used which can change depending on the proxmox api.
related to #233
related to #10227
related to #10858