Fixed IP assignment under DHCP

General questions.
BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: Fixed IP assignment under DHCP

Post by BeBiMa » May 15th, 2019, 3:25 pm

I know that this dirty patch works somehow.

But
  • the patch is quick and dirty hack
  • therefore the patch wasn't accepted formally
  • some developper is official working on this ( see bugzilla )
  • I personally am doing a rework myself, maybe I'll find the error soon.
    Main goal is to enhance efficiency and readability
-Bernhard
Image
Unitymedia Cable Internet ( 32MBit )

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: Fixed IP assignment under DHCP

Post by BeBiMa » May 24th, 2019, 11:05 am

I have removed the "patch". It was a quick and dirty workaround, which didn't solve the problem really. Sorry.
I have added a new file to my post above, which will be send as patch to the devel list. Please test and report.

This just a bug fix for #12050.
My work on this WUI function will go further. Main topics
  • If you add a new fixed lease, at the moment the WUI page is going in 'edit mode'. You have to press "update" to finish the operation. It should be possible to do this with one step only.
  • Adding dynamic leases ( devices identified by MAC address ) to the list of fixed leases should check the condition of disjointness of fixed and dynamic leases. This avoids possible problems with the DHCP daemon.
  • The handling of advanced options is similiar to the handling of fixed leases in the WUI. Maybe there are bugs also.
Bernhard
Image
Unitymedia Cable Internet ( 32MBit )

fkienker
Posts: 126
Joined: March 3rd, 2011, 4:59 pm

Re: Fixed IP assignment under DHCP

Post by fkienker » May 24th, 2019, 1:10 pm

I can report that your fix at least fixes the issue with converting a dynamic lease to a fixed lease and no longer deletes anything in the fixed lease table. It does leave it in update mode, which apparently is the new normal. FYI - once upon a time it was NOT this way. The entry was simply added to the fixed leases and it was up to the user to click on the update button and make the desired changes.

However, no good deed goes unpunished.

When adding a new fixed lease from scratch, not converting a dynamic lease, after adding it the entry is ALSO left in the update mode. I find this quite counter-intuitive. I just added what I needed - why would I need to update the information? It does save your work after clicking the update button but is a departure from how things used to work.

Your DHCP web page changes are at least usable in it's current state, even if it seems pretty rough.

I really sympathize with your plight. We had been making customization's to this cgi script for years to add things we specifically needed. A little over a year ago we finally gave up because of the state of this code. This module desperately needs to be re-written from scratch. It has become a hodge-poge of changes and additions collected over the years from it's original transition from Smoothwall/IPCop. I'd be quite surprised if anyone really knows how it works at this point.

Best regards,
Fred

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: Fixed IP assignment under DHCP

Post by BeBiMa » May 24th, 2019, 1:24 pm

Adding a new fixed lease at the moment does add the entry on the first click, but it isn't sorted in ( thus being the topmost entry in table ).
The update just rewrites the information and does the sort.

Bug #12050 was introduced by "forgetting" to save the entry in the first step. One reason more for doing it the straight way. ;)
Image
Unitymedia Cable Internet ( 32MBit )

fkienker
Posts: 126
Joined: March 3rd, 2011, 4:59 pm

Re: Fixed IP assignment under DHCP

Post by fkienker » May 24th, 2019, 1:37 pm

My hat is off to you for getting it to work at all! This should probably should be filed under "All's Well That Ends Well".

Thanks for all you hard work. I have a pretty good idea hard this was to fix.

Best regards,
Fred

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: Fixed IP assignment under DHCP

Post by BeBiMa » May 24th, 2019, 2:18 pm

It wasn't hard to fix.
But not easy to find, because I wished to understand what's going on. ;)

One more case for encouraging of testing by a broad audience.

Bernhard
Image
Unitymedia Cable Internet ( 32MBit )

RichardB
Posts: 15
Joined: May 31st, 2019, 6:00 pm

Re: Fixed IP assignment under DHCP

Post by RichardB » June 1st, 2019, 2:54 am

I had the same problem and did a not of searching and testing. The result is my first forum entry documenting how to work around the webGUI problem until a fix is released. But it is also useful information for folks who have to import a large number of fixed leases. The link to my solution is given below:

viewtopic.php?f=27&t=22850

RichardB
Posts: 15
Joined: May 31st, 2019, 6:00 pm

Re: Fixed IP assignment under DHCP

Post by RichardB » June 1st, 2019, 2:02 pm

cryptosteve wrote:
May 15th, 2019, 4:28 am
Yes, you can edit fixleases and after that the entries appears in web gui after that. But as I understand you also have to edit /var/ipfire/dhcp/dhcp.conf with additional lines for every fixlease-entry to make it work as expected.
Actually, after editing /var/ipfire/dhcp/fixleases and having the third comma field blank, all you need to do is go to the webGUI DHCP Server page and the contents of fixleases will be shown but not enabled. Just, enable the lease and IPFire will create an appropriate /var/ipfire/dhcp/dhcpd.conf entry. If the third field was set to on then in the webGUI, uncheck the enable box and recheck it, IPFire will create the appropriate /var/ipfire/dhcp/dhcpd.conf entry.

User avatar
RHV1
Posts: 43
Joined: May 10th, 2015, 1:12 am
Contact:

Re: Fixed IP assignment under DHCP

Post by RHV1 » June 22nd, 2019, 4:39 am

this was driving me crazy on a new install of 132 for a new ISP, replacing an old server, etc.
For now I've copied the files from the old to the new. looks like I should have waited a few weeks for 133.

MysteryGoat
Posts: 6
Joined: May 18th, 2019, 9:47 pm

Re: Fixed IP assignment under DHCP

Post by MysteryGoat » June 30th, 2019, 8:03 am

Core 133 fixed it. Thank you devs for letting me get my network back to normal.

BeBiMa
Posts: 2842
Joined: July 30th, 2011, 12:55 pm
Location: Mannheim

Re: Fixed IP assignment under DHCP

Post by BeBiMa » July 4th, 2019, 12:46 pm

MysteryGoat wrote:
June 30th, 2019, 8:03 am
Core 133 fixed it. Thank you devs for letting me get my network back to normal.
Nervermind.

Just a note about editing Ipfire settings and config files:
The main processing in Ipfire is as follows. Configuration is done mainly in the web interface. These settings are stored in "internal" files called settings (or fixedleases in case of DHCP). The real configuration of the systems functions is stored in the "external" files defined by the program. The web pages contain enable/save/... buttons, which start the process of converting the settings to configuration files and restarting of the associated function.
Thus one should know about the relations of the files for the concrete function.
A change to a config file doesn't show up in the WUI and may be deleted by a web operation. On the other hand a change to a settings file doesn't change the config file without starting the conversion from the web page.
Image
Unitymedia Cable Internet ( 32MBit )

Post Reply