#内网段IP
:global ipnetmask "192.168.0."
#内网IP起止
:for aaa from 1 to 254 do={
:global s 0
:global e 0
:foreach a in=[/ip firewall connection find src-address~($ipnetmask . $aaa)] do={
:if ([/ip firewall connection get $a protocol]="tcp") do={
:set s ($s+1)}
:if ([/ip firewall connection get $a protocol]="udp") do={
:set e ($e+1)}
}
:put ($ipnetmask . $aaa . " tcp-" . $s . " udp-" . $e)}
由于本脚本过于暴力,CPU不够牛的自觉绕路,省得卡掉线还怪我。看不懂也请自觉绕路,看得懂的自行修改下内网IP段就能用了。