Created
July 13, 2024 05:56
-
-
Save k1pfel/8002113e152363757c69ccd36a6afd03 to your computer and use it in GitHub Desktop.
mikrotik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:global addold | |
:global addnew | |
:set addnew [/interface get [/interface find name="pppoe-cu"] running] | |
:if ($addnew=true) do={ | |
:set addold [/ip address get [/ip address find dynamic=yes interface="pppoe-cu"] address] | |
:set addold [:pick $addold 0 ([:len $addold ] -3)] | |
/ip firewall nat set [/ip firewall nat find comment="nat"] dst-address=$addold | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment