-
Notifications
You must be signed in to change notification settings - Fork 124
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
Conversation
…into small-changes
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 |
There was a problem hiding this comment.
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
I was able to reduce the keyfile down to this:
However, the interface doesn't come up correctly on first boot. The I had to use |
The following snippet shows how to assign the following to eth0: | ||
|
||
* static IP range: `192.0.2.1/24` | ||
* gateway: `192.0.2.255` |
There was a problem hiding this comment.
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
|
||
The following snippet shows how to assign the following to eth0: | ||
|
||
* static IP range: `192.0.2.1/24` |
There was a problem hiding this comment.
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
|
||
* 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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, the first DNS address should be 192.168.124.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh! sorry for the copy-pasta error!
---- | ||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's link to the issue in the tracker for additional visibility - coreos/fedora-coreos-tracker#358
---- | ||
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if users haven't setup a user/password in their Ignition config, they won't be able to login via the console to perform the nmcli
commands. May be worth mentioning that rebooting the host is another workaround, if they only have SSH keys setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor fixups but not worth blocking on
@mike-nguyen Do you have some cycles to review this and/or test out using keyfiles? |
I'll take a look |
mode: 0600 | ||
overwrite: true | ||
contents: | ||
inline: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be inline: |
. The pipe is important. I got an error when I didn't use it.
Besides the missing pipe in the comment above, I was able to get static networking to work on a network without DHCP using libvirt. |
OK, I'm going to merge this and fix the pipe issue in a quick follow-up. Thanks @adriannemora for the content! |
Follow-up in #40 |
This is a simple example of how to assign a static IP address to an interface on FCOS.