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

networking: Document how to customize NIC names #146

Merged
merged 1 commit into from
Aug 7, 2020

Conversation

kelvinfan001
Copy link
Member

@kelvinfan001 kelvinfan001 commented Aug 7, 2020

Document how to customize NIC names using link files, udev rules, and kernel arguments.

@kelvinfan001 kelvinfan001 requested a review from dustymabe August 7, 2020 16:38
@kelvinfan001
Copy link
Member Author

kelvinfan001 commented Aug 7, 2020

Should this be under the "network.adoc" page?

@kelvinfan001 kelvinfan001 linked an issue Aug 7, 2020 that may be closed by this pull request
@kelvinfan001 kelvinfan001 force-pushed the customize-nic branch 2 times, most recently from 6537d79 to 5859906 Compare August 7, 2020 16:51
modules/ROOT/nav.adoc Outdated Show resolved Hide resolved
modules/ROOT/pages/customize-nic.adoc Outdated Show resolved Hide resolved
mode: 0644
contents:
inline: |
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="12:34:56:78:9a:bc", ATTR{type}=="1", NAME="infra"'
Copy link
Member

Choose a reason for hiding this comment

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

off topic: is ATTR{type}=="1" a way to match based on the type of networking interface?

Copy link
Member Author

Choose a reason for hiding this comment

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

😮
I believe it is. This would help a lot with supporting custom names in networking devices in console-login-helper-messages!

@kelvinfan001 kelvinfan001 force-pushed the customize-nic branch 2 times, most recently from 7e68ca2 to 684a69c Compare August 7, 2020 18:35
----

== Networking in the Initramfs via Kernel Arguments
If networking in the initramfs is required, the Dracut argument `ifname=` dynamically creates a udev rule to change the name of a NIC.
Copy link
Member

Choose a reason for hiding this comment

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

It feels like we might need to give the user some more background information. Maybe something like:

Suggested change
If networking in the initramfs is required, the Dracut argument `ifname=` dynamically creates a udev rule to change the name of a NIC.
If networking in the initramfs is required, the kernel argument `ifname=` will dynamically create a udev rule to change the name of a NIC in the initramfs. If the custom name needs to be applied to the real root then a systemd .link file or udev rule, as discussed earlier on this page, will need to get created via Ignition. See [this issue](https://github.com/coreos/fedora-coreos-tracker/issues/553) for more details.

Copy link
Member

Choose a reason for hiding this comment

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

ahh. I see this information is in the last paragraph. Maye we can add some of this down there and add a link to the issue down there so people can get more context on why they need to do both.

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM one final suggestion.

Thanks @kelvinfan001


Currently, unlike other parts of the networking config from the initramfs (e.g. static IPs, hostnames, etc.), these udev rules are not persisted into the real root. If the custom name needs to be applied to the real root, either a link file or udev rule must be created, as shown above. See xref:https://github.com/coreos/fedora-coreos-tracker/issues/553[this issue] for more details.

For example, to name NIC with the MAC `12:34:56:78:9a:bc` to "infra", provide the argument `ifname=infra:12:34:56:78:9a:bc`. A udev rule like the following would be created in the initramfs:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For example, to name NIC with the MAC `12:34:56:78:9a:bc` to "infra", provide the argument `ifname=infra:12:34:56:78:9a:bc`. A udev rule like the following would be created in the initramfs:
For example, to give the NIC with the MAC `12:34:56:78:9a:bc` a name of "infra", provide a `ifname=infra:12:34:56:78:9a:bc` kernel argument. A udev rule would be created in the initramfs like:

@kelvinfan001 kelvinfan001 merged commit d056637 into coreos:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

networking: document how to customize a NIC name
4 participants