Command Line questions:: How to add/remove a static DHCP entry and turn on/off 2.5ghz radio via CLI

I need to be able to add and remove static entries via ssh the command line. I can of course ssh into the HL1 device but I do not know the commands to add /remove an entry in DHCP. Likewise I want to be able to turn on/off the 2.5ghz radio to test interference etc (my device I connect to also have 2.5ghz radio).

So in particular. Via command line.

  1. List the dhcp table

  2. add and remove a static link from mac address, IP 192.168.12.155 and a lease time.

  3. How do I turn on off the 2.5 ghz radio?

bonus questions:

a) list what devices are connected to a mesh and get their signal noise values

b) How do i set the dynamic lease range from the cli

c) Is there. comprehensive manual for the CLI or is that just learning about OpenWRT? What is the best reference for either? Command Line questions:: How to add/remove a static DHCP entry and turn on/off 2.5ghz radio via CLI

We have something very close to a standard OpenWrt system, and what that means is that an AI (e.g. Claude or ChatGPT) can probably do a good job of answering these kind of questions if you can’t find the answer on the OpenWrt wiki or on their forums.

Nevertheless, some hints:

  • read the ‘Configuring via the command line’ section in the HaLowLink user guide, in particular how you can see what CLI actions correspond to UI changes
  • click on the ‘set static’ button on the status page, and see what pops up
  • cat /var/dhcp.leases
  • iwinfo wlan0 assoclist

Let us know after having read these if you get stuck.

Hi @semicolonsutra
Bunch of quick answers from me - but I strongly recommend following James’ suggestions to learn this stuff!

List the dhcp table

cat /tmp/dhcp.leases


add and remove a static link from mac address, IP 192.168.12.155 and a lease time

uci add dhcp host
uci add_list dhcp.@host[-1].mac='AA:BB:CC:DD:EE:FF'
uci set dhcp.@host[-1].ip='192.168.12.155'
uci set dhcp.@host[-1].leasetime='5d'
uci commit dhcp
reload_config

How do I turn on off the 2.5 ghz radio

uci show wireless to find the radio section with band 2g in my case:
wireless.radio0.band='2g'

So I’d run,

uci set wireless.radio0.disabled=1
uci commit wireless
reload_config

list what devices are connected to a mesh and get their signal noise values

iwinfo mesh0 assoclist should give what you want. You may also want to see iw dev mesh0 mpath dump. Assuming your interface is called mesh0. (It might be wlan0 on our devices).


How do i set the dynamic lease range from the cli

Through uci on the dhcp config - specifically the start and limit fields. See Testing to determine if you are a bot!


Is there. comprehensive manual for the CLI or is that just learning about OpenWRT

It’s mostly just about learning OpenWrt and how to manipulate UCI. As James has mentioned, the OpenWrt docs are particularly helpful for Testing to determine if you are a bot!, dhcp, Testing to determine if you are a bot!, and some other base config files.

1 Like

Thank you sir! Much obliged!