Skip to content

Commit

Permalink
Add documentation for static IP address on FCOS (#30)
Browse files Browse the repository at this point in the history
* Add documentation for static IP address on FCOS

* Make changes based on input from @miabbott

* Fix copy/paste error
  • Loading branch information
adriannemora authored Feb 4, 2020
1 parent 58a9ab9 commit 2f62807
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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
Expand Down
46 changes: 46 additions & 0 deletions modules/ROOT/pages/static-ip-config.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
: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: `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
[source, yaml]
----
variant: fcos
version: 1.0.0
storage:
files:
- path: /etc/NetworkManager/system-connections/eth0.nmconnection
mode: 0600
overwrite: true
contents:
inline:
[connection]
type=ethernet
interface-name=eth0
[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
----
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`

0 comments on commit 2f62807

Please sign in to comment.