Monday, August 24, 2015

Dual WAN Load Balancing pppoe-clients PCC

Result


########PPPoE-CLIENTS##########
/interface pppoe-client
add ac-name="" add-default-route=yes allow=pap,chap default-route-distance=1 dial-on-demand=no \
    disabled=no interface=ether1 keepalive-timeout=60 max-mru=1480 max-mtu=1480 mrru=1600 name=\
    pppoe-out1 password=XXXX profile=default service-name="" use-peer-dns=yes user=\
    XXXXXX
add ac-name="" add-default-route=yes allow=pap,chap default-route-distance=1 dial-on-demand=no \
    disabled=no interface=ether2 keepalive-timeout=60 max-mru=1480 max-mtu=1480 mrru=1600 name=\
    pppoe-out2 password=XXXXXXXXXX profile=default service-name="" use-peer-dns=yes user=\
    XXXXXXXXX


########FIREWALL MANGLE########
/ip firewall mangle
add chain=prerouting in-interface=pppoe-out1
add chain=prerouting in-interface=pppoe-out2
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan1_conn per-connection-classifier=\
    both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan2_conn per-connection-classifier=\
    both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=wan1_conn \
    new-routing-mark=to_wan1
add action=mark-routing chain=prerouting connection-mark=wan2_conn \
    new-routing-mark=to_wan2

########FIREWALL NAT#########
/ip firewall nat
add action=masquerade chain=srcnat out-interface=pppoe-out1
add action=masquerade chain=srcnat out-interface=pppoe-out2

########IP ROUTE############
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_wan1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_wan2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 scope=30 target-scope=10

7 comments: