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 using the relevant software package.

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

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.