FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
321 views 0 comments
by anonymous
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 anonymous

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