Skip to main content
Version: 3.6.0 (Latest)

Networking

By default, Kairos ISOs are configured to automatically get an IP from the network interface. However, depending on the base system you have chosen, there are different way to configure networking. This section collects information on setting network configuration depending on the base that is being chosen (openSUSE, Alpine, Ubuntu).

There are different network managers depending on the distro:

  • connman is available on Alpine-based distribution. By default is enabled on Kairos Alpine flavored variants.
  • systemd-based flavors are all using systemd-networkd

Static IP​

To get a static IP, you can additionally define the following in your configuration file, depending on the network-manager being used:

stages:
initramfs:
- files:
- path: /var/lib/connman/default.config
permissions: 0644
content: |
[service_eth0]
Type = ethernet
IPv4 = 192.168.122.170/255.255.255.0/192.168.122.1
IPv6 = off
Nameservers = 1.1.1.1

Bonding​

Bonding setup with Ubuntu can be configured via systemd-networkd (Ubuntu based images) and wicked (openSUSE based images), consider the following examples:

#cloud-config
name: "My Deployment"
stages:
boot:
- name: "Setup network"
commands:
- systemctl restart systemd-networkd
initramfs:
# Drop network config file
- name: "Setup hostname"
hostname: "hostname"
- name: "Setup network files"
files:
- path: /etc/systemd/network/10-bond0.network
content: |
[Match]
Name=bond0
[Network]
DHCP=yes
permissions: 0644
owner: 0
group: 0
- path: /etc/systemd/network/10-bond0.netdev
content: |
[NetDev]
Name=bond0
Kind=bond
[Bond]
Mode=802.3ad
permissions: 0644
owner: 0
group: 0
- path: /etc/systemd/network/15-enp.network
content: |
[Match]
Name=enp*
[Network]
Bond=bond0
permissions: 0644
owner: 0
group: 0
- path: /etc/systemd/network/05-bond0.link
content: |
[Match]
Driver=bonding
Name=bond0
[Link]
MACAddress=11:22:33:44:55:66
permissions: 0644
owner: 0
group: 0
network:
- name: "Setup user ssh-keys"
authorized_keys:
kairos:
- "ssh-rsa AAA..."
- "ssh-rsa AAA..."
# k3s settings
k3s-agent:
enabled: true
env:
K3S_TOKEN: "KubeSecret"
K3S_URL: https://hostname:6443

References​