Possible bug on 6.35.2

Dear all,

We are working for a new VRRP project and found a “inexplicable” error :confused:

I have 2 CCR1009-8G-1S-1S+ configured with VRRP, two WAN’s, all ok. On a second router we configured a “netwatch” to enable or disable a “PPPoE” interface and this is the problem. The “netwach” works correctly but on different interface.
If i open “new terminal”/ interface / print, the “PPPoE” interface is number 12 but when “netwatch” works (disable/enable) on another interface :open_mouth:
If i disable or enable interface from “New terminal” works fine, the problem is only with “netwatch”.


Anyone have idea about this?



Thanks,

Don’t use a fixed object number, use a [find] command…

Yes, i know but i think so it’s a bug. It’s possible?

I would not dare to modify an object by number because the number can change at any time.
Apparently it bites you. Why don’t you use the proper solution shown in many scripting examples?

Sorry, but i don’t say if i works with numbers i only say the “problem” and the question is, this is a “bug”? only.

I work every day with rOS and i know the best practises and proper solutions, this post is only to show a possible bug.



Thanks,

Usually commands does not know id if print function is not executed.
You should try to edit your script like this:
/interface print
/interface and_the_rest_of_your_command

Ok but does it matter?
Why would you ever want to use /interface set 0 xxxx?
Isn’t it much better and safer to use /interface set [find name=“interfacename”] xxxx ?
When I look in my /interface print output the interface numbers change e.g. when an L2TP user logs in.
I would never ever want to run a background script on a fixed item number…

Maybe one can say that the real bug is that fixed item numbers are allowed from script context…

Yes, you should use commands with find function included. I was just describing why it does not work in Netwatch same way as it does in CLI.

also, why not just “/interface set interfacename xxxx”? :smiley:

Yes, this is the better solution, and works fine but repeat, this post is only to present a “possible” bug on firmware.


Thanks to all!

it’s not a bug because the index depends on previous ‘print’ command. for example:

[admin@TestPlace] /interface> print where name="ether6"
Flags: D - dynamic, X - disabled, R - running, S - slave 
 #     NAME
 0  RS ether6
[admin@TestPlace] /interface> disable 0
[admin@TestPlace] /interface> print where name="ether7" 
Flags: D - dynamic, X - disabled, R - running, S - slave 
 #     NAME
 0  RS ether7
[admin@TestPlace] /interface> disable 0

in those cases “disable 0” will disable two different interfaces

so just use “/interface disable pppoe-out1” and “interface enable pppoe-out1” commands in NetWatch scripts

p.s. if you’re afraid that someone will rename the interface, you may use this dirty hack:

[admin@TestPlace] /interface> :put [find name=ether6];
*14
[admin@TestPlace] /interface> disable *14

i.e. use internal interface ID instead of name, it’s constant between interface renaming :slight_smile: