On Linux, Once use kubevpn connect to k8s cluster network, then lost connection to internet network?
Reason
There is no optimal method for setting up DNS in the Linux system, as there are numerous types of Linux distributions.
Expect
Set up a separate DNS for the tun
device
Resolve
Install tools resolvectl
When resolvectl is not installed by default, it can be added to the system using the relevant software package.
Package information for resolvectl
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | systemd-resolved | dnf install systemd-resolved |
Arch Linux | systemd | pacman -S systemd |
Debian | systemd | apt install systemd |
Fedora | systemd-resolved | dnf install systemd-resolved |
Red Hat Enterprise Linux | systemd-resolved | dnf install systemd-resolved |
Rocky Linux | systemd-resolved | dnf install systemd-resolved |
Ubuntu | systemd | apt install systemd |
Verify install
Once installed, you can enable the service by command:
systemctl enable systemd-resolved.service
systemctl start systemd-resolved.service
try command:
resolvectl status
it shows the information related to name resolution coming from the resolve daemon.(If not, please reboot computer and try again).
after finished verify, use kubevpn connect
to connect, all thing should works fine.