вторник, октомври 16, 2012

Policy routing mikrotik

Config lines:

/ip firewall mangle
add action=mark-routing chain=prerouting comment=\
    "RED path" disabled=no new-routing-mark=RED passthrough=no src-address=10.10.10.2-10.10.10.254
add action=mark-routing chain=output comment="mark with RED local address" disabled=no \
    new-routing-mark=RED passthrough=no src-address=10.10.10.1
add action=mark-routing chain=prerouting comment="BLUE path" \
    disabled=no new-routing-mark=BLUE passthrough=no src-address=20.20.20.2-20.20.20.254
add action=mark-routing chain=output comment="mark with BLUE local address" disabled=\
    no new-routing-mark=clients passthrough=no src-address=20.20.20.1

    /ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-mark=RED scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=2.2.2.1 routing-mark=BLUE scope=30 target-scope=10

add check-gateway=ping disabled=no distance=10 dst-address=0.0.0.0/0 gateway=1.1.1.1,2.2.2.1 \
comment="1:1 load-balance [default route] for all other traffic from/through router"
   
ToDo: same achievment but with translated config for Cisco, Juniper, Vayata and/or Linux


Няма коментари: