nediis
1
Hi,
[user@SIN-R1-1] > /ip dhcp-client pri
Columns: INTERFACE, USE-PEER-DNS, ADD-DEFAULT-ROUTE, STATUS, ADDRESS
INTERFACE USE-PEER-DNS ADD-DEFAULT-ROUTE STATUS ADDRESS
0 v80-modem1 no no bound x.x.x.x/32
/ip dhcp-client disable numbers=v80-modem1 ← it’s ok
after that I want to return the setting back
[user@SIN-R1-1] > /ip dhcp-client enable numbers=v80-modem1 ← the interface is empty, I enter it manually
no such item
[user@SIN-R1-1] > /ip dhcp-client pri
Flags: X - DISABLED, I - INVALID
Columns: INTERFACE, USE-PEER-DNS, ADD-DEFAULT-ROUTE
INTERFACE USE-PEER-DNS ADD-DEFAULT-ROUTE
0 X v80-modem1 no no
As a result it doesn’t work when I try to enable
[:parse “/ip dhcp-client $1 $InterfaceISP2”]
v80-modem1 - vlan interfaces
RB3011 ver 7.11.2
v80-modem1 is not a number, is it?
The number is at the start of the line (the # column) and is 0 in this case.
nediis
3
why, then
user@SIN-R1-1] > /interface/ethernet/disable numbers= ← press TAB
ether… ether9 sfp1
and working
?
I expect it’s a bug. Ask MikroTik support if you care that much.
An interface name is not a number. Deal with it.
nediis
5
It’s a pity that this is a bug and not a new feature
(evl /ip/dhcp-client/disablenumbers=v80-modem1)
VS
(evl /ip/dhcp-client/disablenumbers=(evl (evl /ip/dhcp-client/findwhere=$interface;$add-default-route;$default-route-distance;$us
e-peer-dns;$use-peer-ntp;$dhcp-options;$script;$status;$address;$netmask;$gateway;$dhcp-server;$primary-dns;$secondary-dns;$prima
ry-ntp;$secondary-ntp;$caps-managers;$expires-after;$invalid;$dynamic;$disabled;$comment;$.id;$.nextid;$.dead;(= $interf (- $v80
$modem1));0)))
beyond any bug:
- numbers should not be used on scripts (this is not the time to explain here, see the other dozens of posts about it in the forum)
- don’t forget the quotes for the strings, especially if there is a “-” in the name
- dhcp-client do not have name, so you must search it by interface
So, the correct syntax is:
/ip dhcp-client disable [find where interface="v80-modem1"]
/ip dhcp-client enable [find where interface="v80-modem1"]
Learn how to script first, then talk about bugs.
nediis
7
(evl /ip/dhcp-client/disablenumbers=(evl (evl /ip/dhcp-client/findwhere=$interface;$add-default-route;$default-route-distance;$us
e-peer-dns;$use-peer-ntp;$dhcp-options;$script;$status;$address;$netmask;$gateway;$dhcp-server;$primary-dns;$secondary-dns;$prima
ry-ntp;$secondary-ntp;$caps-managers;$expires-after;$invalid;$dynamic;$disabled;$comment;$.id;$.nextid;$.dead;(= $interf (- $v80
$modem1));0)))
&&
/ip dhcp-client disable [find where interface=“v80-modem1”]
Isn’t this the same thing?
that’s not what the question was about …
Ah… NOT?
Topic title: Can’t enable dhcp-client