Community discussions

MikroTik App
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

l2tp-client per script enable not consistent working

Wed May 23, 2018 10:21 am

hello there,

i have made a customscript for the tr069 client to reach the server either over lte1 or ether1 for failoverreasons.
to reach the management on the lte1 side i did an l2tp-client successfuly.

to only establish the l2tp-client (via lte1) i do it on availibilitybases - so if primay target is not reachable, enable the l2tp-client.

:local i 0; {:do {:set i ($i + 1)} while (($i < 5) && ([/ping 8.8.8.8 interval=3 count=1 interface=vlan31-hsi ]=0))};
:if ($i=5 && [/ip route get [find comment="floating-hsi"] distance]=255) do={:log info "Primary hsi down";
/ip route set [find comment="floating-hsi"] distance=1
/ip route set [find comment="floating-mgt"] distance=4
/interface l2tp-client enable 0
}

its not reproduceable but from time to time the script cannot enable the l2tp-client (which is disabled if primary is available again).

the error i receive on the cli (when i try to execute is:
no such item (4)

if i try to enable it a second time its no problem to enable the client.

any ideas? - may this is a bug?

thank you!

christian
 
wil
just joined
Posts: 10
Joined: Wed Jun 04, 2014 4:42 pm

Re: l2tp-client per script enable not consistent working

Wed May 23, 2018 3:02 pm

Hi,

I had the same issue. If I added a "/interface l2tp-client print" before accessing the element it worked for me every time. Looks like the interpreter needs to evaluate the elements in a category first before you can reliably access the elements. It makes no difference if you try to access via element number or name.

Bye,
wil
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: l2tp-client per script enable not consistent working

Wed May 23, 2018 3:25 pm

hey wil!

wow! great help!

yes it works with this workaround!

thank you!

christian
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: l2tp-client per script enable not consistent working

Sun May 27, 2018 10:48 am

hey again,

jfyi:

/interface l2tp-client find name XX
is also working.

greetings

christian
 
msatter
Forum Guru
Forum Guru
Posts: 1631
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: l2tp-client per script enable not consistent working

Sun May 27, 2018 10:59 am

hey again,

jfyi:

/interface l2tp-client find name XX
is also working.

greetings

christian
Can you try and see if this also works?

/ip route set [find where comment="floating-hsi"] distance=1
/ip route set [find where comment="floating-mgt"] distance=4
One RB4011 (cooled) and a RB760iGS (hEX S) in series. 4011 Does PPPoE/IKEv2.
Running:
RouterOS 6.47 / Winbox 3.24 / MikroTik APP 1.3.12
NordVPN viewtopic.php?f=2&t=158439&p=781009 for multiple connections.
 
steger
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 77
Joined: Sat Jul 29, 2006 9:17 am

Re: l2tp-client per script enable not consistent working

Sun May 27, 2018 11:10 am

hi,

just checked it out. - no its not working.

christian
 
msatter
Forum Guru
Forum Guru
Posts: 1631
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: l2tp-client per script enable not consistent working

Sun May 27, 2018 12:55 pm

hi,

just checked it out. - no its not working.

christian
Thanks for checking out.
One RB4011 (cooled) and a RB760iGS (hEX S) in series. 4011 Does PPPoE/IKEv2.
Running:
RouterOS 6.47 / Winbox 3.24 / MikroTik APP 1.3.12
NordVPN viewtopic.php?f=2&t=158439&p=781009 for multiple connections.

Who is online

Users browsing this forum: Baidu [Spider] and 27 guests