Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for static IP address on FCOS #30

Merged
merged 4 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions modules/ROOT/pages/static-ip-config.adoc
Original file line number Diff line number Diff line change
@@ -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`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's only a single IP being assigned here; just drop range

* gateway: `192.0.2.255`
Copy link
Member

@miabbott miabbott Jan 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses that end in 255 are typically broadcast addresses and wouldn't be used as a gateway. I'd suggest changing the value of the static IP to 192.0.2.10/24 and the gateway to 192.0.2.1

* 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=<insert UUID>
[ethernet]
mac-address=<insert 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
Copy link
Member

@miabbott miabbott Jan 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be tweaked slightly so that inline: is a child of contents:. And the mode should be set to 0644, I think.

      contents: 
        inline: |
          [connection]
          id=Uplink
          type=802-3-ethernet
          autoconnect=true
          interface-name=eth0
          match-device=interface-name:eth0
          uuid=<insert UUID>
          [ethernet]
          mac-address=<insert 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.