From f4412f4e4974a16814962a3e1e51b08137001bc5 Mon Sep 17 00:00:00 2001 From: Adrianne Mora Date: Sat, 25 Jan 2020 15:52:21 -0500 Subject: [PATCH 1/3] Add documentation for static IP address on FCOS --- modules/ROOT/nav.adoc | 1 + modules/ROOT/pages/static-ip-config.adoc | 40 ++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 modules/ROOT/pages/static-ip-config.adoc diff --git a/modules/ROOT/nav.adoc b/modules/ROOT/nav.adoc index 00b1ff67..c9d13136 100755 --- a/modules/ROOT/nav.adoc +++ b/modules/ROOT/nav.adoc @@ -6,6 +6,7 @@ *** xref:producing-ign.adoc[Producing an Ignition File] *** xref:fcct-config.adoc[FCCT Specification] *** xref:using-fcct.adoc[Using FCCT] +*** xref:static-ip-config.adoc[Configuring a Static IP Address] *** xref:sysctl.adoc[Kernel Tuning] *** xref:running-containers.adoc[Running Containers] ** OS updates diff --git a/modules/ROOT/pages/static-ip-config.adoc b/modules/ROOT/pages/static-ip-config.adoc new file mode 100644 index 00000000..04becd87 --- /dev/null +++ b/modules/ROOT/pages/static-ip-config.adoc @@ -0,0 +1,40 @@ +:experimental: += Configuring FCOS to Use a Static IP Address +By default, an FCOS instance will attempt to grab a DHCP address from the local network. However, if you need FCOS to use a static IP address, you can do so by specifying the NetworkManager configuration in the Ignition configuration file. + +As with any custom configuration on FCOS, you can write specific files in the xref:ign-storage.adoc[`storage` node] of the Ignition file. + +The following snippet shows how to assign the following to eth0: + +* static IP range: `192.0.2.1/24` +* gateway: `192.0.2.255` +* DNS: `192.0.2.53` + +.Example assignment of static IP address +[source, yaml] +---- +variant: fcos +version: 1.0.0 +storage: + files: + - path: /etc/NetworkManager/system-connections/eth0.nmconnection + mode: 0600 + overwrite: true + contents: inline + [connection] + id=Uplink + type=802-3-ethernet + autoconnect=true + interface-name=eth0 + match-device=interface-name:eth0 + uuid= + [ethernet] + mac-address= + [ipv4] + method=manual + addresses=192.0.2.1/24 + gateway=192.0.2.255 + dns=192.0.2.53 + dns-search=example.com +---- +NOTE: During the initramfs portion of the boot process, dracut will attempt to grab a DHCP address. When it times out, Ignition will take over and write the above configuration into the filesystem. From 969c806b3bf9d5c7d1623282ce3d9c1a2a759e54 Mon Sep 17 00:00:00 2001 From: Adrianne Mora Date: Sun, 2 Feb 2020 19:58:07 -0500 Subject: [PATCH 2/3] Make changes based on input from @miabbott --- modules/ROOT/pages/static-ip-config.adoc | 34 ++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/modules/ROOT/pages/static-ip-config.adoc b/modules/ROOT/pages/static-ip-config.adoc index 04becd87..66f24446 100644 --- a/modules/ROOT/pages/static-ip-config.adoc +++ b/modules/ROOT/pages/static-ip-config.adoc @@ -6,9 +6,10 @@ As with any custom configuration on FCOS, you can write specific files in the xr The following snippet shows how to assign the following to eth0: -* static IP range: `192.0.2.1/24` -* gateway: `192.0.2.255` -* DNS: `192.0.2.53` +* static IP: `192.0.2.10/24` +* gateway: `192.0.2.1` +* DNS: `92.168.124.1;1.1.1.1;8.8.8.8` +* DNS search domain: `redhat.com` .Example assignment of static IP address [source, yaml] @@ -20,21 +21,26 @@ storage: - path: /etc/NetworkManager/system-connections/eth0.nmconnection mode: 0600 overwrite: true - contents: inline - [connection] - id=Uplink - type=802-3-ethernet - autoconnect=true + contents: + inline: + [connection] + type=ethernet interface-name=eth0 - match-device=interface-name:eth0 - uuid= + [ethernet] mac-address= + [ipv4] method=manual - addresses=192.0.2.1/24 - gateway=192.0.2.255 - dns=192.0.2.53 - dns-search=example.com + 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 ---- NOTE: During the initramfs portion of the boot process, dracut will attempt to grab a DHCP address. When it times out, Ignition will take over and write the above configuration into the filesystem. + +If the interface does not come up correctly on first boot, issue the following commands to force the static IP to take effect: + +`nmcli connection down eth0` + +`nmcli connection up eth0` From 8f03ebd69c99e10446e5d66681bf35771779fef6 Mon Sep 17 00:00:00 2001 From: adriannemora <56655876+adriannemora@users.noreply.github.com> Date: Mon, 3 Feb 2020 10:34:24 -0500 Subject: [PATCH 3/3] Fix copy/paste error --- modules/ROOT/pages/static-ip-config.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/static-ip-config.adoc b/modules/ROOT/pages/static-ip-config.adoc index 66f24446..a0294067 100644 --- a/modules/ROOT/pages/static-ip-config.adoc +++ b/modules/ROOT/pages/static-ip-config.adoc @@ -8,7 +8,7 @@ The following snippet shows how to assign the following to eth0: * static IP: `192.0.2.10/24` * gateway: `192.0.2.1` -* DNS: `92.168.124.1;1.1.1.1;8.8.8.8` +* DNS: `192.168.124.1;1.1.1.1;8.8.8.8` * DNS search domain: `redhat.com` .Example assignment of static IP address