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 static network setup: #251

Merged
merged 2 commits into from
Nov 23, 2024
Merged

Conversation

jacobweinstock
Copy link
Member

@jacobweinstock jacobweinstock commented Nov 23, 2024

Description

For environments where DHCP is not available, I've added a script that will statically configure network interfaces. The IPAM
info must be passed in via kernel cmdline parameters and be in the appropriate format.

ipam=<mac-address>:<vlan-id>:<ip-address>:<netmask>:<gateway>:<hostname>:<dns>:<search-domains>:<ntp>

This is probably only useful for the HookOS ISO. For the Tinkerbell stack, Smee handles patching the ISO at runtime to include this ipam= parameter.

To facilitate this static ip configuration, scripts were placed into the host filesystem at /etc/init.d. Files in this location are run at startup by the init system. This makes it possible to just add the scripts as files in the linuxkit yaml file. The vlan.sh script was moved to an init.d script because it needs to run before the static-network script. The vlan.sh script was updated to use posix /bin/sh instead of bash because the host only has /bin/sh.

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock jacobweinstock changed the title Add static network script: Add static network setup: Nov 23, 2024
For environments where DHCP is not available,
I've added a script that will statically configure
network interfaces. The IPAM info must be passed in
via kernel cmdline parameters and be in the appropriate
format.

ipam=<mac-address>:<vlan-id>:<ip-address>:<netmask>:<gateway>:<hostname>:<dns>:<search-domains>:<ntp>

This is probably only useful for the HookOS ISO.
For the Tinkerbell stack, Smee handles patching the ISO
at runtime to include this `ipam=` parameter.

To facilitate this static ip configuration, scripts were placed
into the host filesystem at /etc/init.d. Files in this location
are run at startup my the init system. This makes it possible
to just add the scripts as files in the linuxkit yaml file.
The vlan.sh script was moved to an init.d script because it
needs to run before the static-network script. The vlan.sh script
was updated to use posix /bin/sh instead of bash because the host
only has /bin/sh.

Signed-off-by: Jacob Weinstock <[email protected]>
With the move of the vlan script to
an init.d script the image build for IP
is not needed.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock merged commit 68fdd4d into tinkerbell:main Nov 23, 2024
29 checks passed
@jacobweinstock jacobweinstock deleted the static-ipam branch November 23, 2024 22:56
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.

1 participant