Modfiying config files

Hi,
is there a way of reloading modified config files by an editor in the WebUI?
For example /var/ipfire/dhcp/dhcpd.conf

Best regards

Did you restart dem dhcp daemon and reload the webui?
Or restart the computer.

Hi,
the dhcp daemon is not running at the moment, but I tried this already. I do not exactly know what you mean by reloading the webui. Reloading the browser does not work.

The general way of config in IPFire is as follows:

  • set values in the WebUI
  • save / apply by press the button
  • the .cgi writes the appropriate ā€˜settingsā€™ and ā€˜.confā€™ file
  • the service is restarted, readinf the .conf file

All settings not present in the WebUI must go to the associated ā€˜.conf.localā€™ file. This is included by the ā€˜.confā€™ file and not altered by the WebUI.

In your case you should put these settings into /var/ipfire/dhcp/dhcpd.conf.local
This file isnā€™t displayed by the WebUI.

What do you actually intent to do? There is no need to edit the dhcpd config file for any changes. The web ui has got that function. The config is ony loaded when the deamon is getting started. So to take effect on any changes you need to restart the deamon to reload the config file. Thatā€™s what the web ui does if you save changes for the dhcp.

Sometimes you will see outdated information because of your browser cache. So you will need to reload the whole website.

I have to create a lot of fixed dhcp entries. So my intention was to edit the dhcpd.conf file which would be a lot faster than creating the entries with the webui. But this seems not to be an option.
Thank you for your answers!

There is an option.
You can edit /var/ipfire/dhcp/fixleases.
But you should do it carefully. The meaning of the fields can be guessed from the already defines leases in the WebUI.

In case of dhcpd Ipfire splits the config in ā€˜settingsā€™ and ā€˜fixleasesā€™ ( and ā€˜advoptions*ā€™ ).

Ah OK I did the same. The easiest way is to download the file to your PC via SFTP and edit it there, but itā€™s not all about dhcpd.conf. You will also need to edit the file ā€œfixleasesā€.

When you copy your edited files back make sure the user ā€œadminā€ is still allowed to read/write the files. Otherwise you will have the problem that you canā€™t make any changes to them via the web ui anymore.

Hi Bernhard,
cool, that is the solution. It is enough to edit the fixleases. When webui is reloaded it also generates the dhcpd.conf. :slightly_smiling_face:
Thatā€™s what I wanted. :+1:

Thats not just right. :wink:
You should save the dhcp settings in the WebUI. Just reloading the page doesnā€™t rewrite dhcp.conf.

FYI: the format of the fixleases file is:
<MAC addr>,<fixed IP>,<on/off>,<next server>,<file name>,<root-path>,<remark>

Iā€™ve just tried it again. I edit the fixrelease in editor an upload it to ipfire. The I press F5 in webui, the new entries are shown in webui and they are also created in the dhcpd.conf. Perhaps the write process is triggered by reloading the page in browser?

If you just did a ā€˜saveā€™ or ā€˜enable/disable toggleā€™, yes. :slight_smile:

1 Like