• Breaking News

    Monday 9 January 2017

    107. Mikrotik Load Balancing(ECMP Method) 2 WANs(Static IP)


    You can contact me: plus.google.com/+PhallaCCMT; youtube.com/phallaccmt; facebook.com/Phalla.CCMT; twitter.com/PhallaCCMT and Phalla.CCMT@gmail.com

    Script:

    /ip address
    add address=192.168.168.1/24 interface=bridge-LAN network=192.168.168.0
    add address=103.28.0.254/30 interface=WAN2 network=103.28.0.252
    add address=103.28.2.254/30 interface=WAN1 network=103.28.2.252

    /ip dns
    set  servers=8.8.8.8,8.8.4.4

    /ip firewall nat
    add action=masquerade chain=srcnat out-interface=WAN1
    add action=masquerade chain=srcnat out-interface=WAN2

    /ip route
    add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253


    Ref: http://wiki.mikrotik.com/wiki/ECMP_load_balancing_with_masquerade


    Other Config

    /ip firewall nat
    add action=masquerade chain=srcnat out-interface=WAN1
    add action=masquerade chain=srcnat out-interface=WAN2

    /ip firewall mangle
    add action=mark-connection chain=input in-interface=WAN1 new-connection-mark=\
        WAN1_Conn passthrough=yes
    add action=mark-connection chain=input in-interface=WAN2 new-connection-mark=\
        WAN2_Conn passthrough=yes
    add action=mark-routing chain=output connection-mark=WAN1_Conn \
        new-routing-mark=WAN1_Conn passthrough=no
    add action=mark-routing chain=output connection-mark=WAN2_Conn \
        new-routing-mark=WAN2_Conn passthrough=no

    /ip route
    add distance=1 gateway=103.28.2.253 routing-mark=WAN1_Conn
    add distance=1 gateway=103.28.0.253 routing-mark=WAN2_Conn
    add check-gateway=ping distance=1 gateway=103.28.0.253,103.28.2.253


    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel