Skip to content

Instantly share code, notes, and snippets.

@k1pfel
Created July 13, 2024 05:56
Show Gist options
  • Save k1pfel/8002113e152363757c69ccd36a6afd03 to your computer and use it in GitHub Desktop.
Save k1pfel/8002113e152363757c69ccd36a6afd03 to your computer and use it in GitHub Desktop.
mikrotik
: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