Skrypty do Mikrotika

Mikrotik – skrypty i polecenia

 

//Zmiana adresu mac ethernetu

/interface ethernet set etherX mac-address=XX:XX:XX:XX:XX:XX

// Brama (trasa ) domyślna

 ip route add dst-address=0.0.0.0/0 gateway=10.130.0.23

  // Trasa statyczna (dla konkretnej destynacji)

ip route add dst-address=10.238.0.0/16 gateway=10.103.0.70

// Zdalny skan urządzeniem klienckim – wynik w terminalu

interface wireless scan wlan1 duration=3

// Markowanie ruchu i kolejki Mangle

 :for x from=2 to=254 do={ /ip firewall mangle add chain=prerouting src-address=("192.168.20.$x" ) action=mark-packet new-packet-mark=( "$x_out_20" ) passthrough=no }

:for x from=2 to=254 do={ /ip firewall mangle add chain=postrouting dst-address=("192.168.20.$x" ) action=mark-packet new-packet-mark=( "$x_in_20") passthrough=no }

Queue Tree

:for z from 2 to 254 do={ /queue tree add parent=DOWN20 packet-mark=( "$z_in_20") limit-at=128000 queue=default priority=7 max-limit=10M }


:for b from 2 to 254 do={ /queue tree add parent=UP20 packet-mark=( "$b_out_20" ) limit-at=128000 queue=default priority=7 max-limit=2M }