Flatcar Container Linux

How to Change Networking in Flatcar

Discover how to customize your networking setup in Flatcar Linux, including connecting to machines with static IP addresses, and enabling or disabling DHCP.

How to Change Networking in Flatcar

By default, Flatcar Linux fetches the IP via DHCP from the first ethernet port it encounters. Nevertheless, there are scenarios where network configurations may need customization, such as when establishing connections with machines using static IP addresses. This guide demonstrates how to create your own networkd units for such customizations.

Consider using our UMH Integrated Platform for pre-configured instances to simplify your provisioning process. Contact us for further details.


If you're not using a pre-configured instance, it's possible to modify networking settings post-installation. Here are the steps:

  1. Locate your networkd units: Networkd units are typically found in the /etc/systemd/network/ directory. If you manually place files onto the filesystem, you'll need to reload networkd using the command sudo systemctl restart systemd-networkd.
  2. Create a static.network file: This file will be used to set up a static IP on enp2s0. Create the static.network file and place it in the /etc/systemd/network/ directory.
  3. Apply the configuration: Once the file is correctly placed, apply the configuration by running the command sudo systemctl restart systemd-networkd.
If you are using ignition files, and your network has no DHCP, you need to configure the linux kernel parameters as shown below.

The following YAML file provides an example configuration. This configuration fetches the IP via DHCP in the range from the first port (in file 10-enp6s0.network), sets up a second network in the range with a DHCP server and static leases (in file 20-enp8s0.network), and on one port, allows connection to a network consisting of a single machine at (thereby creating a DMZ around that machine, file 30-enp7s0.network).

- name: 10-enp6s0.network
  contents: |

    Description=Port 1 / WAN

    # for testing only
    # DHCP=ipv4

- name: 20-enp8s0.network
  contents: |

    Description=Port 2 / LAN. Yes it is Port 2 and not port 3. The numbering is weird in the K300.


    # The "[DHCPServerStaticLease]" section configures a static DHCP lease to assign a fixed IPv4 address to a specific device based on its MAC address. 
    # This section can be specified multiple times.
- name: 30-enp7s0.network
  contents: |

    Description=Port 3 / PLC. Yes it is Port 3 and not port 2. The numbering is weird in the K300.


For more detailed instructions and additional functionality of networkd, visit the official documentation. With these steps, you should be able to successfully configure your Flatcar Linux machine to use different networking. Remember to always double-check your configuration and test your connection to ensure everything is working as expected.

Static IP using Ignition & iPXE

In addition to your normal network setup, you need to change the following inside the profile sections of flatcar-0 and flatcar-1.

Inside your boot->args section add a new entry:



  • is the interface ip
  • is the gateway ip
  • is the netmask
  • flatcar-0 is the hostname
  • eth0 is the interface
  • none is the auto config setting (this is normally DHCP)
  • is the primary DNS server

On boot (iPXE)

Inside the iPXE shell you need to do the following.

Stay up-to-date

Subscribe to the UMH Learning Hub Newsletter to receive the latest updates and gain early access to our blog posts.