script load balancing ini hasil utak-atik dari berbagai sumber, antara lain

forum mikrotik, blog-blog tentang mikrotik yang banyak sekali hingga aku lupa alamat blognya, terima kasih buat semuanya….

/interface set ether1 name=local
/interface set ether2 name=speedy1
/interface set ether3 name=speedy2

/ip address add address add=192.168.1.1/24 interface=local
/ip address add address add=192.168.2.2/30 interface=speedy1
/ip address add address add=192.168.3.2/30 interface=speedy2

/ip dns set servers=203.134.193.74,202.134.0.155

/interface pppoe-client
add ac-name=”” add-default-route=no allow=pap,chap,mschap1,mschap2 comment=”” \
dial-on-demand=no disabled=no interface=speedy1 max-mru=1480 max-mtu=1480 \
mrru=disabled name=”PPPoE-1″ user=”xxxxxxxxxx@telkom.net” password=”xxxxxx” profile=default \
service-name=”” use-peer-dns=no

add ac-name=”” add-default-route=no allow=pap,chap,mschap1,mschap2 comment=”” \
dial-on-demand=no disabled=no interface=speedy2 max-mru=1480 max-mtu=1480 \
mrru=disabled name=”PPPoE-2″ user=”xxxxxxx@telkom.net” password=”xxxxx” profile=default \
service-name=”” use-peer-dns=no

/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-1 distance=1 check-gateway=arp
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-2 distance=2 check-gateway=arp

/ip firewall mangle add chain=input in-interface=speedy1 action=mark-connection new-connection-mark=jalur01
/ip firewall mangle add chain=input in-interface=speedy2 action=mark-connection new-connection-mark=jalur02

/ip firewall mangle add chain=output connection-mark=jalur01 action=mark-routing new-routing-mark=ke_jalur01
/ip firewall mangle add chain=output connection-mark=jalur02 action=mark-routing new-routing-mark=ke_jalur02

/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=local per-connection-classifier=both-addresses:2/0 action=mark-connection new-connection-mark=jalur01 passthrough=yes
/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=local per-connection-classifier=both-addresses:2/1 action=mark-connection new-connection-mark=jalur02 passthrough=yes

/ip firewall mangle add chain=prerouting connection-mark=jalur01 in-interface=local action=mark-routing new-routing-mark=ke_jalur01
/ip firewall mangle add chain=prerouting connection-mark=jalur02 in-interface=local action=mark-routing new-routing-mark=ke_jalur02

/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-1 routing-mark=ke_jalur01 check-gateway=arp
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-2 routing-mark=ke_jalur02 check-gateway=arp

/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-1 distance=1 check-gateway=arp
/ip route add dst-address=0.0.0.0/0 gateway=PPPoE-2 distance=2 check-gateway=arp

/ip firewall nat
add chain=srcnat action=masquerade out-interface=PPPoE-1 comment=”” disabled=no
add chain=srcnat action=masquerade out-interface=PPPoE-2 comment=”” disabled=no

Iklan