Configuring FCOS to Use a Static IP Address
As with any custom configuration on FCOS, you can write specific files in the storage
of the Ignition file.
The following snippet shows how to assign a static configuration to enp1s0
:
FCOS uses predictable interface names by default. Please take care to use the correct interface name for your hardware. |
-
static IP:
192.0.2.10/24
-
gateway:
192.0.2.1
-
DNS:
192.168.124.1;1.1.1.1;8.8.8.8
-
DNS search domain:
redhat.com
Example assignment of static IP address
variant: fcos
version: 1.3.0
storage:
files:
- path: /etc/NetworkManager/system-connections/enp1s0.nmconnection
mode: 0600
overwrite: true
contents:
inline: |
[connection]
type=ethernet
id='Custom interface'
interface-name=enp1s0
[ethernet]
mac-address=<insert MAC address>
[ipv4]
method=manual
addresses=192.0.2.10/24
gateway=192.0.2.1
dns=192.168.124.1;1.1.1.1;8.8.8.8
dns-search=redhat.com
Additional parameters for NetworkManager key files can be found in the NetworkManager documentation. |