E
E
Evgeny702014-12-01 12:54:43
openvpn
Evgeny70, 2014-12-01 12:54:43

Mikrotik script to enable ovpn client?

Several ovpn clients are running on Mikrotik, each is tied to a specific port. How to implement that the tunnel would rise only if there is a link on the port and, accordingly, close when the device is disconnected from the port?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya Evseev, 2014-12-03
@IlyaEvseev

More or less like this:

:global u
/interface ethernet monitor ether1 once do={
  :set u $status
  }
:if ($u = "link-ok") do={  /interface openvpn enable 0}

Syntax description and examples - wiki.mikrotik.com/wiki/Manual:Scripting#See_also

E
Evgeny70, 2014-12-04
@Evgeny70

Tried:
:global u
/interface ethernet monitor ether3 once do={
:set u $status
}
:if ($u = "link-ok") do={ /interface ovpn-out3 enable 0}
Doesn't work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question