10922 questions

13024 answers

20290 comments

27201 members

0 votes
106 views 0 comments
by
Hello ,

I need to automate the addition of a new static lease on the LAN with UCI command.

Attacched you can see the manual configuration that I want to translate in UCI commands.

Now I'm using these one but sometimes they don't work:

1: 'uci set dhcp.@host[0].name="QCA"',

   2: 'uci set dhcp.@host[0].ip="192.168.240.171"',

   3: 'uci commit dhcp',

    4:'uci set dhcp.@host[0].mac="d8:5b:76:ab:a0:36"'

   5: 'uci show dhcp'

Thanks for the help,

Alessandro

1 Answer

0 votes
by

Hi,

Navigate to static leases in WebUI and add few

Now connect RUT via CLI and execute uci show with greping one of your MAC

For ex:- uci show | grep 01:1E:42:11:12:41

Now you got additional info on which you can continue grepping

For ex:- uci show | grep dhcp.@host

host

host name:- computer

mac:-01:1E:42:11:12:41

ip:- 192.168.1.2

with this info you can see what uci commands you need to use to ass static lease via uci add