Skip to main content

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 systemPackage nameInstallation
AlmaLinuxsystemd-resolveddnf install systemd-resolved
Arch Linuxsystemdpacman -S systemd
Debiansystemdapt install systemd
Fedorasystemd-resolveddnf install systemd-resolved
Red Hat Enterprise Linuxsystemd-resolveddnf install systemd-resolved
Rocky Linuxsystemd-resolveddnf install systemd-resolved
Ubuntusystemdapt 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.