How do you bulk insert reserved IPs (static leases)? Here's the answer! (Slate AX)

Not a technical support request, but there are no other forums to post this in. I am hoping this could help someone who Google’s a similar request in the future.

After much playing around in Luci (advanced settings) and Googling, trying to find out how I can import my large list of reserved IPs, I have found my answer. Here’s what I did:

  1. Login to the router, advanced settings, login with the same password you used to login to the main interface, system, software. Search for openssh-sftp-server and install it. This is what allows someone like me who doesn’t get on with a command line, to use a file browser.

  2. Download an SSH client if you don’t have one already. I use Bitvise. Put in the local IP of your router (192.168.8.1 most likely), username root, and the password you used to login to the router interface. Connect.

  3. Open an SFTP window and navigate to /etc/config. Open the dhcp file.

  4. Scroll to the bottom of the file, where you will find any reserved IPs that you already have. You can amend or delete the existing ones, or add new ones. The format is:

config host
	option mac '00:00:00:00:00:00'
	option ip '192.168.8.2'
	option name 'Device'
  1. Save and check that it worked by refreshing the LAN page on the routers interface. If you’re using Bitvise, as soon as you save the file, it is uploaded to the server. If you use something like Filezilla then after you save the file, Filezilla will ask you if you would like upload and overwrite.

You can skip the ‘option name’ one if you don’t want to name it. If you want to ensure you have the right format, you can always add a reserved IP on the interface, and then copy it directly from the file as many times as you need and edit the copies.

Be careful to keep the quotes, general formatting, and that all device names do NOT have spaces in (I use dashes), such as Mobile-Phone-Samsung-S23, otherwise while nothing bad will happen, the routers admin page will load no reserved IP entries. Just come back and edit it. I missed a quote on one of my devices but all was fine.

I personally just copied and pasted my MACs and IPs from a separate document I have which lists all of my network devices, but you may be able to make some kind of macro or script that can fill in these details from a spreadsheet or something.

You can also move them about if you’re like me and want all of the IPs in order, something you can’t do in any of the graphical interfaces.

You can refresh the router admin panel LAN page, or the static leases Luci page, and the changes will be reflected immediately. Of course devices will need to reconnect for the reservations to take affect, and I like to do a reboot for good measure but it is not needed.

This has certainly made making large changes to the reserved IPs much, much easier, but it is a shame neither graphical interface has some kind of bulk facility, or the ability to export an excel template which I could then fill and import.

I hope this helps someone!

3 Likes

Thanks for that but this has been mentioned here on several occasions previously.

Yeah, but this kind of stuff gets buried eventually, it seems. I rather wish there was a way to apply expanded tags to threads to help ‘drill down’ into this form, a-la a more proper knowledgebase instead of just dumping it all into ’ Technical Support for Routers’.

1 Like

Totally agree with you.

Hi, thanks a lot -- I found it super useful.

Another note -- Comments begins with #.

I have a question, too: is it possible to use the name specified in the dhcp file to display on the http://192.168.8.1/#/clients page? I would like for the router to display the same name, but as of now it seems that I would need to rename each entry on that page by hand.

My guess is that there should be a way by playing with /etc/config/gl-client, but I was curious to see if anyone had came up with a better option.

Adding the entries to /etc/config/gl-client is the only way because the options there are used for the GUI names and symbols.

1 Like

Thanks a lot. Follow-up question (I may create a new post if it's more convenient): is there a way of using that same list of static lease for AdGuard? It does not use the names I saved, but the IPs on its dashboard.

No, since they work differently.

1 Like

Ok, thanks.

I ended up editing the /etc/hosts file on the router to include aliases for the static ip. They are now displayed from adguard's interface, which is very convenient.

1 Like