Skip to content

Instantly share code, notes, and snippets.

@jjcodes78
Created July 9, 2019 01:58
Show Gist options
  • Save jjcodes78/027e3dc71c3368c9a25137ae52b48dd6 to your computer and use it in GitHub Desktop.
Save jjcodes78/027e3dc71c3368c9a25137ae52b48dd6 to your computer and use it in GitHub Desktop.
:global addNetmapRules do={
:for i from=0 to ($count - 1) do={
:local pRange "$($portStart + ($i * $portsPerAddr))-$($portStart + (($i + 1) * $portsPerAddr) - 1)"
/ip firewall nat add chain=src-nat action=netmap protocol=tcp \
src-address=($srcStart + ($i * 256)) to-address=$toAddr to-ports=$pRange
/ip firewall nat add chain=src-nat action=netmap protocol=udp \
src-address=($srcStart + ($i * 256)) to-address=$toAddr to-ports=$pRange
}
}
@FABIO29JOSE
Copy link

como se usa este escript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment