Hi Team, i am writing a basic script but cannot figure out how to enable/disable use-peer-dns on pppoe from terminal. Maybe someone can point me in the right direction:
As far as i understand i go to
/interface pppoe-client
and than have to
set use-peer-dns=yes
but then it ask me for a value. What value is that?
/interface pppoe-client
set [ find interface=<pppoe interface name> ] use-peer-dns=yes
( is in your case pppoe-out1).
If you’re doing it interactively, then you can first run /interface pppoe-client print, which will print numbers in the first column (most likely starting from 0 and uniformly increasing). You can use this number for the subsequent set command, but beware that numbers are only valid until print command is executed next time (in any configuration context). So it’s better to use construct in the code example above, just use properties to find command which uniquely determine the item you want to change using set command.
In your particular case the above might seem as unnecessary complication (because you only have one item in the configuration sub menu), but the same principles apply in all configuration sub menus, including some address lists or firewall filter rule lists where it’s normal to have tens (if not thousands) of items.