Community discussions

MikroTik App
 
lerinave
just joined
Topic Author
Posts: 3
Joined: Fri Dec 31, 2021 10:09 pm

Multiple values to pass to one parameter in CLI

Fri Dec 31, 2021 10:14 pm

Happy New Year!

I'm trying to save some work with my DHCP Server static leases. I need to include two DHCP Options (custom DNS) to each lease, but can't figure out a way to put both DHCP Options in one line of command.

e.g. two DHCP Options "A1" and "A2"

The following command works, but only adds A1:
/ip dhcp-server lease add address=x.x.x.x dhcp-option="A1" mac-address=aa:aa:aa:aa:aa:aa

The following command does not work, and has a "amibuity" error:
/ip dhcp-server lease add address=x.x.x.x dhcp-option="A" mac-address=aa:aa:aa:aa:aa:aa

The following does not work either
/ip dhcp-server lease add address=x.x.x.x dhcp-option="A1" dhcp-option="A2" mac-address=aa:aa:aa:aa:aa:aa

What I really want is something that can pass over "A1" and "A2" both to the argument dhcp-option
/ip dhcp-server lease add address=x.x.x.x dhcp-option="A1"&&"A2" mac-address=aa:aa:aa:aa:aa:aa

but "A1"&&"A2" clearly does not work. Is there a way to pass over two values to dhcp-option?
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: Multiple values to pass to one parameter in CLI

Sun Jan 02, 2022 5:20 pm

Yes, dhcp-option=A1,A2.

Who is online

Users browsing this forum: satepson and 40 guests