I’m using these scripts to add a public IP and ISP gateway addresses obtained from a DHCP or PPPoE client to an address list (on different routers). Is there a way to do the same thing on an LTE interface? I don’t see any place for the script in Winbox settings for the LTE interface or the LTE APN profile.
Also, are these good, or should something be added/changed to avoid an issue?
Script for DHCP client - added in “Advanced” tab:
:if ($bound = 1) do={
/ip firewall address-list {
remove [find list="WAN-IP" address!=$"lease-address"];
:if ([:len [find list=WAN-IP address=$"lease-address"]]=0) do={
add list="WAN-IP" address=$"lease-address" comment="Public IP";
}
:if ([:len [find list=WAN-ISP address=$"server-address"]]=0) do={
remove [find list="WAN-ISP" address!=$"gateway-address"];
add list="WAN-ISP" address=$"server-address" comment="ISP's DHCP";
}
:if ([:len [find list=WAN-ISP address=$"gateway-address"]]=0) do={
remove [find list="WAN-ISP" address!=$"server-address"];
add list="WAN-ISP" address=$"gateway-address" comment="ISP's Gateway";
}
}
}
Script for PPPoE client - added in “Scripts” tab of PPP profile:
On up:
/ip firewall address-list add list=WAN-IP address=$"local-address";
/ip firewall address-list add list=WAN-ISP address=$"remote-address";
On down:
/ip firewall address-list remove [find where list="WAN-IP"];
/ip firewall address-list remove [find where list="WAN-ISP"];