-
Notifications
You must be signed in to change notification settings - Fork 42
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
Error connect tunnel with KubeVPN when IPv6 disable. #244
Comments
:> Hello.
@leduyquy can you provide some log, and which os you are using? macos/windows/linux |
Hi @whomobile This is out put log when I connect with IPv6 disable. I'm using Ubuntu 23.10 |
got it, by the way. I am @wencaiwulue ... |
@leduyquy can you use the following code, and save to main.go, then run it with ·go run main.go·, and show the result? i want to detect if ipv6 is enabled ~ thanks in advance ~ package main
import (
"fmt"
"net"
"os"
)
func main() {
addrs, err := net.InterfaceAddrs()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
ipv6Enabled := false
for _, addr := range addrs {
// Type assertion to net.IPNet to get the IP address without the mask.
if ipNet, ok := addr.(*net.IPNet); ok && ipNet.IP.To16() != nil {
if ipNet.IP.To4() == nil { // This is an IPv6 address
ipv6Enabled = true
break
}
}
}
if ipv6Enabled {
fmt.Println("IPv6 is enabled on this system.")
} else {
fmt.Println("IPv6 is not enabled on this system.")
}
} |
Hi @wencaiwulue This is result |
ok, got it, i will use this way to detect ipv6 is enable or not. thanks |
Hi @wencaiwulue Line 58 in 984ab2c
cfg.Addr instead of Addr6 ? quick search https://github.com/search?q=repo%3Akubenetworks%2Fkubevpn%20net.ParseCIDR&type=code but it looks not root cause. |
Yes, bug 😂, maybe nobody using kubevpn on bsd system 😂😂😂 |
here is commit: #249, please take a review, thanks ~ |
maybe better check if ipv6 enabled from below. Line 88 in cc032c4
also based on below. how come even that env var set the value if IPv6 is not enabled? It looks like below can be issue when IPv6 is not enabled. Line 56 in cc032c4
|
Yes, you are right. If env ipv6 set, means wants to set ipv6 addr. Maybe better way is add flag |
@whomobile |
@leduyquy already release v2.2.9, you can have a try ~ |
Hello.
I have setup KubeVPN for my cluster but when use kubectl connect to cluster with kubevpn plugin it show error can not setup ipv6. For my company policy, we must disable IPv6 on our computers and not enable it.
Is there any way we can setup a tunnel with kubevpn without enabling IPv6 on my PC?
Thank you.
The text was updated successfully, but these errors were encountered: