Also, are these good, or should something be added/changed to avoid an issue?
Script for DHCP client - added in "Advanced" tab:
Code: Select all
: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:
Code: Select all
/ip firewall address-list add list=WAN-IP address=$"local-address";
/ip firewall address-list add list=WAN-ISP address=$"remote-address";
Code: Select all
/ip firewall address-list remove [find where list="WAN-IP"];
/ip firewall address-list remove [find where list="WAN-ISP"];