Community discussions

MikroTik App
 
MichaelDC
just joined
Topic Author
Posts: 19
Joined: Mon May 22, 2017 2:40 pm

Trigger Script when LTE receives IP address

Fri Sep 10, 2021 11:49 pm

Hi,

I am wondering if it is possible to trigger a script when an LTE modem on a RB receives an IP address.
When teh LTE modem makes a connection the IP address is being added to the route list but is there any way to use that as a trigger? I would need to enable/disable an interface when this occurs.

Any help is appreciated.

Thanks
Michaël
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 12:21 am

Is not possible to add a script to lte1 interface like other ppp connections.

You can check on scheduled script if the interface are obtained the IP or not:
:if ([:len [/ip add find where interface=lte1]] > 0) do={
    :put "IP obtained"
} else={
    :put "waiting for IP"
}
 
tdw
Forum Guru
Forum Guru
Posts: 1841
Joined: Sat May 05, 2018 11:55 am

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 12:22 am

The DHCP client can run a script, see https://help.mikrotik.com/docs/display/ ... DHCPClient
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 12:23 am

The DHCP client can run a script, see https://help.mikrotik.com/docs/display/ ... DHCPClient

Assuming than the user use a standard MikroTik device like SXT-R with R11e-LTE,
the lte1 (on default configuration) do not need any DHCP client...
If the user refer to other models not specified is another thing...

@MichaelDC please specify everything or else it will get confusing, thanks.
 
MichaelDC
just joined
Topic Author
Posts: 19
Joined: Mon May 22, 2017 2:40 pm

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 11:15 am

Hi,
I use an RBM33G ROS v6.48 with 2 R11E LTE6 modules.
The DHCP client unfortunately doesn't see LTE1 and LTE2 so I can't trigger from there.
Using a scheduled script is a possibility but I would have preferred to trigger it from state change on the LTE itself to limit the time in which it is in an incorrect state.

Thanks
Michaël
 
tdw
Forum Guru
Forum Guru
Posts: 1841
Joined: Sat May 05, 2018 11:55 am

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 3:37 pm

I had not remembered that lte interfaces themselves do not use the DHCP client - it is from using setups with passthrough. I don't know if you could abuse passthrough with an otherwise unused local interface or if the underlying network driver would foil this approach.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 3:42 pm

The "easy" soluction is: MikroTik must add on-up and on-down on all interface (also ethernet, wlan, etc.)
 
MichaelDC
just joined
Topic Author
Posts: 19
Joined: Mon May 22, 2017 2:40 pm

Re: Trigger Script when LTE receives IP address

Sat Sep 11, 2021 8:24 pm

The "easy" soluction is: MikroTik must add on-up and on-down on all interface (also ethernet, wlan, etc.)
I'll second that but might take a while
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: Trigger Script when LTE receives IP address

Sun Sep 12, 2021 1:36 pm

In units with one lte interface I add that action to my netwatch who detect if internet is UP or DOWN.... and at netwatch UP script I can do additional job's to do. Check my signature or post:
Additional Scripts for LTE

Who is online

Users browsing this forum: Bing [Bot], joshnielsen, phascogale and 57 guests