Share on Social Media

In this article, you will learn about k3OS Network Configuration. #centlinux #linux #k8s

What is k3OS? :

This is a supplementary article to Install Lightweight Kubernetes (K3s) Cluster with k3OS, where we have seen, how to configure a Kubernetes cluster with k3OS operating system. k3OS is purposely built for lightweight Kubernetes (k3s), therefore, it has limited tools and configurations, that are mandatory to run Kubernetes.

We have accepted all the default network options as provided by Installation process during configuration of k3OS. However, if you are not happy with default DHCP assigned IP Addresses and Hostname, then you can change it as per the following procedures.

Identify Network in k3OS:

k3OS network is powered by connman. Therefore, we can use connmanctl command to manage our network.

But, first we have to identify the connman network service bound to eth0 device.

$ sudo connmanctl services
*AO Wired                ethernet_000c29eeaf0e_cable
*AR Wired                ethernet_aae0cd9b094b_cable
*AR Wired                ethernet_da9d68a358a4_cable
*AR Wired                ethernet_d62316791d59_cable

$ sudo connmanctl services ethernet_000c29eeaf0e_cable
  Type = ethernet
  Security = [  ]
  State = online
  Favorite = True
  Immutable = False
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth0, Address=00:0C:29:EE:AF:0E, MTU=1500 ]
  IPv4 = [ Method=auto, Address=, Netmask=]
  IPv4.Configuration = [ Method=auto ]
  IPv6 = [  ]
  IPv6.Configuration = [ Method=auto, Privacy=disabled ]
  Nameservers = [  ]
  Nameservers.Configuration = [  ]
  Timeservers = [  ]
  Timeservers.Configuration = [  ]
  Domains = [  ]
  Domains.Configuration = [  ]
  Proxy = [ Method=direct ]
  Proxy.Configuration = [  ]
  mDNS = False
  mDNS.Configuration = False
  Provider = [  ]

We have identified our connman network service.

Set Static IP Address on k3OS:

To set static IP address for our connman network service, we can use following command.

$ sudo connmanctl config ethernet_000c29eeaf0e_cable --ipv4 manual --nameservers

Set Preferred DNS Server on k3OS:

Use following command to set preferred DNS server(s) for our connman network service.

$ sudo connmanctl config ethernet_000c29eeaf0e_cable --nameservers

Disable IPv6 Networking in k3OS:

Disable IPv6 using following command.

$ sudo connmanctl config ethernet_000c29eeaf0e_cable --ipv6 off

Restart connman service to apply changes.

$ sudo service connman restart
 * WARNING: you are stopping a boot service
 * Caching service dependencies ...                                       [ ok ]
 * Stopping k3s-service ...                                               [ ok ]
 * WARNING: you are stopping a boot service
 * Stopping issue ...
 * start-stop-daemon: no matching processes found                         [ ok ]
 * WARNING: you are stopping a boot service
 * Stopping haveged ...                                                   [ ok ]
 * Stopping ccapply ...
 * start-stop-daemon: no matching processes found                         [ ok ]
 * Stopping connman ...                                                   [ ok ]
 * Starting connman ...                                                   [ ok ]
 * Starting haveged ...
 * Starting ccapply ... * Starting issue ...
 * Starting k3s-service ...
                                                                          [ ok ]
[INFO]  Skipping k3s download and verify
[INFO]  env: Creating environment file /etc/rancher/k3s/k3s-service.env
[INFO]  openrc: Creating service file /etc/init.d/k3s-service
[INFO]  openrc: Enabling k3s-service service for default runlevel
[INFO]  No change detected so skipping service start                      [ ok ]

Change Hostname of k3OS machine:

In k3OS, the /etc is automatically reverts any changes after reboot. Therefore, to persistently change Hostname of k3OS machine, we have to change it in k3OS configuration files.

$ sudo vi /var/lib/rancher/k3os/hostname

and update hostname therein.

Reboot k3OS machine to see the effect.

$ sudo reboot

Login to system after reboot.

login as: rancher
rancher@'s password:
Welcome to k3OS!

Refer to for README and issues

By default mode of k3OS is to run a single node cluster. Use "kubectl"
to access it.  The node token in /var/lib/rancher/k3s/server/node-token
can be used to join agents to this server.


It shows that, the change in Hostname is now persistent. It also configures server name resolution using Local DNS Resolver.

Check the FQDN using following command.

$ hostname

Hostname has been persistently changed on k3OS.

Conclusion – k3OS Network Configuration:

In this article, you have learned about k3OS Network Configurations.

Leave a Reply

Your email address will not be published. Required fields are marked *