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

DHCP config fails during install #667

Open
ashahn1 opened this issue Dec 20, 2024 · 1 comment
Open

DHCP config fails during install #667

ashahn1 opened this issue Dec 20, 2024 · 1 comment

Comments

@ashahn1
Copy link

ashahn1 commented Dec 20, 2024

Describe the bug
The bug is identical to this one: #593

During install the DHCP configuration script fails to correctly set the IP ranges.

To Reproduce
Steps to reproduce the behavior:

  1. Install FOG on Ubuntu Server 24.04 LTS as described in https://docs.fogproject.org/en/latest/installation/server/install-fog-server/#installer-prompts

Software (please complete the following information):

  • FOG version 1.5.10.1629
  • OS: Ubuntu Server 24.04 LTS

Additional context

The problem is located in the functions script (/fogproject/lib/common/functions.sh) at line 255. The command ip -4 addr show | grep -w inet | grep $interface | awk '{print $4}' returns "global" when run on ubuntu. When fed into the function "subtract1fromAddress" this will return an "Invalid IP Passed" error which is in turn pasted into the dhcpd.conf file and causes the dhcp service to fail due to misconfiguration.

My solution was to replace line 255 in /fogproject/lib/common/functions.sh with the following:

echo $(ip -4 addr show | grep -w inet | grep eno2 | awk '{print $2}' | sed 's/...$//')

I can't say if this works for other distro's or versions of Ubuntu but this fixed the issue with Ubuntu Server 24.04 LTS.

mastacontrola added a commit that referenced this issue Jan 14, 2025
mastacontrola added a commit that referenced this issue Jan 14, 2025
@mastacontrola
Copy link
Member

Your call get's the actual devices' IP address, not the broadcast which is where we're trying to get the device from.

Your code also specifically indicates the interface name, which for your system is eno2, but for someone else it might be eth0 or enps01p0 or any other series of information that indicates the name of its interface. So while I'm glad you found a solution for your specific scenario I think a more dynamic approach will work. Hopefully:

I've made a change to how this code gets the broadcast address and should be more consistent across platforms as well.

Can you please try dev-branch (or wait a day and try the stable branch) and see if this is working more consistently for you as well? Thank you in advance.

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

No branches or pull requests

2 participants