Create static IP

I am migrating from pfSense to IPFire and have a bunch of equipment on my LAN.
Since I knew the MAC addresses I have assigned static IP:s to them in pfSense … I exported them also into a text file.
Is there a file in IPFire where I can edit and insert all my IP:s & MAC addresses & descriptions instead of enter them via GUI.

Sure:

/var/ipfire/dhcp/dhcpd.conf
/var/ipfire/dhcp/fixleases

1 Like

The dhcp WUI page stores its fixed leases info in /var/ipfire/dhcp/fixleases

dhcpcd.conf is then built out of the fixleases file and other files for the advamced options, ddns, etc.

So you need to populate the fixleases file with your info to have it added to the dhcpd.conf file.

The format of each line in the fixleases file is comma delimited as follows:-

MAC address using colons , IP Address , on for enabled or blank for disabled , next-server , filename , root path , Remark

No spaces in the file between entries and the commas. I added the spaces to make the data clearer to read. Only the Remark section can have spaces in it and it is the last entry in each line.

After adding the entries to the fixleases file then you need to access the dhcp WUI page. This will update the WUI page fixed leases and also update the dhcpcd.conf file.

3 Likes

Thanks … exactly what I was looking for.
Not quite familiar with IPFire nomenclature.
What is ‘next-server & root path’ in /var/ipfire/dhcp/fixleases

That is for if you are running PXE booting. Generally those will be left blank, together with filename.

The names I used are the same as in the dhcp WUI page in the fixed leases section so you can look in there and also in the wiki for what each entry is related to.

Without PXE setup for a fixed lease then you would have the following format:-

MAC address using colons , IP Address , on for enabled or blank for disabled ,,,, Remark

1 Like

OK - I checked in the wiki and there is one thing I don’t understand in IPFire.
In pfSense/section DHCP Static Mapping Green interface I have to specifiy following:

MAC address,IP,hostname,description

Exampel:
00:E0:67:05:AD:F7, 192.168.1.1, protectli, LAN interface FW6B

which ties IP (192.168.1.1) to a specific host (protectli) so I can use the host instead if IP … for example ‘ping protectli’

Hosts definition is not part of a dhcp server: wiki.ipfire.org - Edit Hosts

Gude!

OK … I will check that

Presuming that you have an equally long list of hosts that you don’t want to manually enter via the Hosts WUI page here is the info on the file and format for the hosts info.

The file is /var/ipfire/main/hosts

Line format is comma delimited again and is:-

on for enabled or blank for disabled , Host IP Address , Hostname , on if Generate PTR is selected or off if Generate PTR is not selected

1 Like

Fine … that was the info I searched … thanks