please anyone can help me
i need a script that check the local-address of pppoe-client and go to the firewall mangle and add the local-address to src-nat number 0 in dst-address
/ppp profile
add change-tcp-mss=yes name="default autoNAT 1" on-up="/ip fire nat set [find where comment=\"changeMe1\" ] dst-address=\$\"local-address\""
add change-tcp-mss=yes name="default autoNAT 2" on-up="/ip fire nat set [find where comment=\"changeMe2\" ] dst-address=\$\"local-address\""
now modify NAT rules:
change/set NAT rule comment to exactly “changeMe1” (without quotes) where dst-address must be set with pppoe-client1 IP and
change/set NAT rule comment to exactly “changeMe2” (without quotes) where dst-address must be set with pppoe-client2 IP
with the next instruction, probably your connection can be disconnected for some seconds:
with winbox on “PPP” / “interface” open pppoe-out1 and on “Dial Out” tab change “Profile” from “default” to “default autoNAT 1”
now open pppoe-out2 and change again “Profile” from “default” to “default autoNAT 2”
from now everytime one of your pppoe-client change IP or go up (after go down) the IP on NAT are updated.
(if you need, you can comment more than one NAT line, or also no one, with same “changeMe” comment, and all are updated at same time without change the script)
If for some reason the NAT rule or comment are removed or changed, nothing happen.
change-tcp-mss=yes is the “default” behavior of “default” rule.
For some reason creating new profile without change-tcp-mss=yes specified, do not set change-tcp-mss=yes…
Must be specified on creation of profile.