Thursday, July 28, 2016

4 Wan Equal Load Balancing PPPoE Clients (PCC)

Ether 1 = DSL 1 =
Ether 2 = DSL 2 =
Ether 3 = DSL 3 =
Ether 4 = DSL 4 =
Ether 5 is your Local

/interface ethernet
set [ find default-name=ether1 ] name=ether1
set [ find default-name=ether2 ] name=ether2
set [ find default-name=ether3 ] name=ether3
set [ find default-name=ether4 ] name=ether4
set [ find default-name=ether5 ] name=ether5
/ip address
add address= interface=ether1 network=
add address= interface=ether2 network=
add address= interface=ether3 network=
add address= interface=ether4 network=
add address= interface=ether5 network=
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 max-mru=1480 max-mtu=\
    1480 name=pppoe-out1 password=#PWD use-peer-dns=no user=#USER1
add add-default-route=yes disabled=no interface=ether2 max-mru=1480 max-mtu=\
    1480 name=pppoe-out2 password=#PWD use-peer-dns=no user=#USER2
add add-default-route=yes disabled=no interface=ether3 max-mru=1480 max-mtu=\
    1480 name=pppoe-out3 password=#PWD use-peer-dns=no user=#USER3
add add-default-route=yes disabled=no interface=ether4 max-mru=1480 max-mtu=\
    1480 name=pppoe-out4 password=#PWD use-peer-dns=no user=#USER4
/ip pool
add name=dhcp_pool1 ranges=
/ip dhcp-server
add address-pool=dhcp_pool1 disabled=no interface=ether1 name=dhcp1
/ip dhcp-server network
add address= gateway=
/ip dns
set allow-remote-requests=yes cache-size=15000KiB servers=\,
/system note set note="Server Configuration By <HAMZA KHALIL> (" show-at-login=yes
/ip firewall mangle
add chain=prerouting in-interface=pppoe-out1
add chain=prerouting in-interface=pppoe-out2
add chain=prerouting in-interface=pppoe-out3
add chain=prerouting in-interface=pppoe-out4
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan1_conn per-connection-classifier=\
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan2_conn per-connection-classifier=\
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan3_conn per-connection-classifier=\
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=wan4_conn per-connection-classifier=\
add action=mark-routing chain=prerouting connection-mark=wan1_conn \
add action=mark-routing chain=prerouting connection-mark=wan2_conn \
add action=mark-routing chain=prerouting connection-mark=wan3_conn \
add action=mark-routing chain=prerouting connection-mark=wan4_conn \
/ip firewall nat
add action=masquerade chain=srcnat out-interface=pppoe-out1
add action=masquerade chain=srcnat out-interface=pppoe-out2
add action=masquerade chain=srcnat out-interface=pppoe-out3
add action=masquerade chain=srcnat out-interface=pppoe-out4
add action=masquerade chain=srcnat comment="Masquerade Dhcp Network" src-address=
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=to_wan1
add check-gateway=ping distance=1 gateway=pppoe-out2 routing-mark=to_wan2
add check-gateway=ping distance=1 gateway=pppoe-out3 routing-mark=to_wan3
add check-gateway=ping distance=1 gateway=pppoe-out4 routing-mark=to_wan4
add check-gateway=ping distance=1 gateway=pppoe-out1
add distance=2 gateway=pppoe-out2
add distance=3 gateway=pppoe-out3
add distance=4 gateway=pppoe-out4


  1. Hamza bro, ye LB wali script failover ka kaam b krti hay kia ?

  2. Hello... how we can forward a udp port from a internal IP (voip-server) to the wan's?

  3. bhai maine ap se 1 sawaal pouchna hai k yr maine dream intenet se fiber pr link liya howa hai or meray pass 24mbps speed hai or mikrotik routerboard pr mera server bana howa hai pppoe or bhai masla yeh arha hai k download jab mai local server dream net jo hai mikrotik se jab mai connect hokr yeh server se downloading kr rha hu tou kbps mai downloading arhe hai jab k yeh tou 1 local sharing server hai nah dream network ka is tou mbps mai downloading ani chaahiye or bhai maine direct tplink pr downloading se checck ki hai tou 1mbps se ly kr 10mbps tak downloading arhe hai so please help me brother...

  4. Sir Unequal with failover chaiye mujhe plz sent kar sakhty ho?