Trigger Script when LTE receives IP address

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

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"
}

The DHCP client can run a script, see https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-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.

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

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.

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

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