Contoh berikut adalah penggunaan PCC untuk loadbalance 3 Line PPPoE
5 Interface yang kita pakai yaitu :
- Public1
- Public2
- Public3
- Proxy
- Local
dan PPPoE name = Speedy1, Speedy2 dan Speedy3
Code:
{{{
/interface ethernet
set 0 name=Public1
set 1 name=Public2
set 2 name=Public3
set 3 name=Proxy
set 4 name=Local
}}}
Dengan IP Address sbb :
Untuk dialup PPPoE nya jangan centang add-default-route nya, kita bikin manual di ip route seperti dibawah ini :
Code:
{{{
/ip address
add address=192.168.11.2/30 interface=Public1
add address=192.168.22.2/30 interface=Public2
add address=192.168.33.2/30 interface=Public3
add address=192.168.3.1/30 interface=Proxy
add address=192.168.2.30/27 interface=Local
}}}
Untuk dialup PPPoE nya jangan centang add-default-route nya, kita bikin manual di ip route seperti dibawah ini :
Code:
{{{
/interface pppoe-client
add ac-name="" add-default-route=no allow=pap,chap,mschap1,mschap2
comment="PPPOE 1" dial-on-demand=no disabled=no interface=Public1
max-mru=1480 max-mtu=\
1480 mrru=disabled name=Speedy1 password=XXXXXXXXX profile=default service-name="" use-peer-dns=no user=XXXXXXXXX@telkom.net
add ac-name="" add-default-route=no allow=pap,chap,mschap1,mschap2
comment="PPPOE 2" dial-on-demand=no disabled=no interface=Public2
max-mru=1480 max-mtu=\
1480 mrru=disabled name=Speedy2 password=XXXXXXXXX profile=default service-name="" use-peer-dns=no user=XXXXXXXXX@telkom.net
add ac-name="" add-default-route=no allow=pap,chap,mschap1,mschap2
comment="PPPOE 3" dial-on-demand=no disabled=no interface=Public3
max-mru=1480 max-mtu=\
1480 mrru=disabled name=Speedy3 password=XXXXXXXXX profile=default service-name="" use-peer-dns=no user=XXXXXXXXX@telkom.net
Code:
{{{
/ip route
add check-gateway=arp comment="Default Route - Distance 1" disabled=no distance=1 gateway=Speedy1
add check-gateway=arp comment="Default Route - Distance 2" disabled=no distance=2 gateway=Speedy2
add check-gateway=arp comment="Default Route - Distance 3" disabled=no distance=3 gateway=Speedy3
add check-gateway=arp comment="PPPoE1 - Distance 1" disabled=no distance=1 gateway=Speedy1 routing-mark=pppoe_1
add check-gateway=arp comment="PPPoE2 - Distance 1" disabled=no distance=1 gateway=Speedy2 routing-mark=pppoe_2
add check-gateway=arp comment="PPPoE2 - Distance 1" disabled=no distance=1 gateway=Speedy3 routing-mark=pppoe_3
}}}
Kemudian untuk rule PCC nya adalah sebagai berikut :
Code:
{{{
/ip firewall mangle
add action=mark-connection chain=prerouting comment="PROXY PCC"
disabled=no dst-address-type=!local dst-port=80,81,8080,8088,3128
in-interface=Proxy \
new-connection-mark=proxy.pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=80,81,8080,8088,3128 in-interface=Proxy
\
new-connection-mark=proxy.pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=80,81,8080,8088,3128 in-interface=Proxy
\
new-connection-mark=proxy.pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
add action=mark-routing chain=prerouting comment="PROXY ROUTE"
connection-mark=proxy.pppoe_1 disabled=no in-interface=Proxy
new-routing-mark=pppoe_1 \
passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=proxy.pppoe_2 disabled=no in-interface=Proxy
new-routing-mark=pppoe_2 passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=proxy.pppoe_3 disabled=no in-interface=Proxy
new-routing-mark=pppoe_3 passthrough=no
add action=mark-connection chain=prerouting comment="LOCAL PCC"
disabled=no dst-address-list=!Transparent dst-address-type=!local
dst-port=\
!80,81,8080,8088,3128 in-interface=Local
new-connection-mark=local.pppoe_1 passthrough=yes
per-connection-classifier=src-address:3/0 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-list=!Transparent dst-address-type=!local
dst-port=!80,81,8080,8088,3128 \
in-interface=Local new-connection-mark=local.pppoe_2 passthrough=yes per-connection-classifier=src-address:3/1 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-list=!Transparent dst-address-type=!local
dst-port=!80,81,8080,8088,3128 \
in-interface=Local new-connection-mark=local.pppoe_3 passthrough=yes per-connection-classifier=src-address:3/2 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_1 \
passthrough=yes per-connection-classifier=src-address:3/0 protocol=udp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_2 \
passthrough=yes per-connection-classifier=src-address:3/1 protocol=udp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_3 \
passthrough=yes per-connection-classifier=src-address:3/2 protocol=udp
add action=mark-routing chain=prerouting comment="LOCAL ROUTE"
connection-mark=local.pppoe_1 disabled=no in-interface=Local
new-routing-mark=pppoe_1 \
passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=local.pppoe_2 disabled=no in-interface=Local
new-routing-mark=pppoe_2 passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=local.pppoe_3 disabled=no in-interface=Local
new-routing-mark=pppoe_3 passthrough=no
}}}
Code:
http://code.google.com/p/warneter/source/browse/wiki/MikrotikPCC.wiki?r=13
kalo output line nya ada 2 gimana,misal 1 lan 1 hotspot?
Jawabannya
Code:
add action=mark-connection
chain=prerouting comment="LOCAL PCC" disabled=no
dst-address-list=!Transparent dst-address-type=!local dst-port=\
!80,81,8080,8088,3128 in-interface=Local
new-connection-mark=local.pppoe_1 passthrough=yes
per-connection-classifier=src-address:3/0 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-list=!Transparent dst-address-type=!local
dst-port=!80,81,8080,8088,3128 \
in-interface=Local new-connection-mark=local.pppoe_2 passthrough=yes per-connection-classifier=src-address:3/1 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-list=!Transparent dst-address-type=!local
dst-port=!80,81,8080,8088,3128 \
in-interface=Local new-connection-mark=local.pppoe_3 passthrough=yes per-connection-classifier=src-address:3/2 protocol=tcp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_1 \
passthrough=yes per-connection-classifier=src-address:3/0 protocol=udp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_2 \
passthrough=yes per-connection-classifier=src-address:3/1 protocol=udp
add action=mark-connection chain=prerouting comment="" disabled=no
dst-address-type=!local dst-port=!53 in-interface=Local
new-connection-mark=local.pppoe_3 \
passthrough=yes per-connection-classifier=src-address:3/2 protocol=udp
add action=mark-routing chain=prerouting comment="LOCAL ROUTE"
connection-mark=local.pppoe_1 disabled=no in-interface=Local
new-routing-mark=pppoe_1 \
passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=local.pppoe_2 disabled=no in-interface=Local
new-routing-mark=pppoe_2 passthrough=no
add action=mark-routing chain=prerouting comment=""
connection-mark=local.pppoe_3 disabled=no in-interface=Local
new-routing-mark=pppoe_3 passthrough=no
rubah in interface=local jadi interface hotspot