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 by following step
(1) Install tools resolvectl
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 |
(2) 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.
(3) Reboot
Please reboot computer, this is very important.
after reboot computer, use kubevpn connect
to connect, all thing should works fine.