wiki:Mikrotik

Version 2 (modified by krit, 4 years ago) (diff)

--

Mikrotik

Checking LTE signal

[admin@G01] > /interface lte info lte1 
           pin-status: no password required
        functionality: full
  registration-status: registered
         manufacturer: "MikroTik"
                model: "R11e-LTE"
             revision: "MikroTik_CP_2.160.000_v012"
     current-operator: TogetherStaySafeTrueH
                  lac: 44509
       current-cellid: 1327422
               enb-id: 5185
            sector-id: 62
           phy-cellid: 81
    access-technology: Evolved 3G (LTE)
       session-uptime: 42m22s
                 imei: 355654091765995
                 imsi: 520002032996393
                 uicc: 8966001020612910001f
    subscriber-number: +CME ERROR: 100
               earfcn: 3750 (band 8, bandwidth 10Mhz)
                 rsrp: -81dBm
                 rsrq: -9.5dB
                 sinr: 6dB

[admin@G01] > 

Script for checking Internet, VPN

[admin@G01] > /system script print 
Flags: I - invalid 
 0   name="script_reboot" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon 
     dont-require-permissions=no last-started=feb/28/2021 16:13:33 run-count=30 
     source=
       :if ([/ping 8.8.8.8 count=3 size=64 interval=2s]=0) do={
        :log error "LTE DOWN";
        /system reboot;
       } else={
        :log info "LTE OK";
       }

 1   name="check_vpn" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon dont-require-permissions=no 
     last-started=feb/28/2021 16:22:33 run-count=15 source=
       :if ([/ping 192.168.59.1 count=3 size=64 interval=2s]=0) do={
           :log error "----VPN DOWN";
           /interface pptp-client set pptp-out1 disabled=yes;
           /delay 1s;
           /interface pptp-client set pptp-out1 disabled=no;
       } else={
         :log info "----VPN OK";
       }

 2   name="check_internet" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon 
     dont-require-permissions=no last-started=feb/28/2021 16:23:33 run-count=29 
     source=
       :if ([/ping 8.8.8.8 count=3 size=64 interval=2s]=0) do={
           :log error "----Internet DOWN";
           /interface lte set numbers=lte1 disabled=yes;
           /system routerboard usb power-reset duration=1;
           :log info "---Power USB DOWN ---";
           /delay 40s;
           /interface lte set numbers=lte1 disabled=no;
           :log info "---Enable lte1 ";
       } else={
           :log info "----Internet OK";
       }   

 3   name="vpn_lossLong" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon 
     dont-require-permissions=no run-count=0 source=
       :if ([/ping 192.168.59.1 count=10 size=64 interval=5s]=0) do={
           :log error "----VPN LOSS LONG DOWN Reboot";
           /system reboot;
       } else={
           :log info "----VPN LOSS LONG OK";
       }
[admin@G01] >