Inidian

Mikrotik 2 Lines PCC

Dec 8th, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.13 KB | None | 0 0
  1. /ip firewall mangle
  2.  
  3. add action=mark-packet chain=prerouting comment=Proxy-Hit disabled=yes dscp=12 new-packet-mark=HIT passthrough=yes
  4.  
  5. add action=mark-connection chain=input comment="PCC RULE —- MARK ALL PPPoE CONN" connection-state=new disabled=yes in-interface=Speedy new-connection-mark=pppoe1_conn passthrough=yes
  6. add action=mark-connection chain=input comment="" connection-state=new disabled=yes in-interface=Speedy1 new-connection-mark=pppoe2_conn passthrough=yes
  7.  
  8. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes in-interface=Speedy new-connection-mark=pppoe1_conn passthrough=yes
  9. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes in-interface=Speedy1 new-connection-mark=pppoe2_conn passthrough=yes
  10.  
  11. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes in-interface=Speedy new-connection-mark=pppoe1_conn passthrough=yes
  12. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes in-interface=Speedy1 new-connection-mark=pppoe2_conn passthrough=yes
  13.  
  14. add action=mark-routing chain=output comment="" connection-mark=pppoe1_conn disabled=yes new-routing-mark=pppoe_1 passthrough=no
  15. add action=mark-routing chain=output comment="" connection-mark=pppoe2_conn disabled=yes new-routing-mark=pppoe_2 passthrough=no
  16.  
  17. add action=mark-connection chain=prerouting comment="PCC RULE MARK HTTP CONN- ProxyUp=Enable" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  18. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  19. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  20.  
  21. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  22. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  23. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether1-Proxy new-connection-mark=http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  24.  
  25. add action=mark-connection chain=prerouting comment="PCC RULE MARK HTTP CONN - ProxyUp=Disable" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  26. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  27. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  28.  
  29. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  30. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  31. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=21,80 in-interface=ether5-local new-connection-mark=http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  32.  
  33. add action=mark-connection chain=prerouting comment="PCC RULE —- MARK – NON -HTTP CONN" connection-state=established disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  34. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  35. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  36.  
  37. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=tcp
  38. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=tcp
  39. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local dst-port=!21,80 in-interface=ether5-local new-connection-mark=non.http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=tcp
  40.  
  41. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=udp
  42. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=udp
  43. add action=mark-connection chain=prerouting comment="" connection-state=established disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=udp
  44.  
  45. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_1 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/0 protocol=udp
  46. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_2 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/1 protocol=udp
  47. add action=mark-connection chain=prerouting comment="" connection-state=related disabled=yes dst-address-type=!local in-interface=ether5-local new-connection-mark=non.http_pppoe_3 passthrough=yes per-connection-classifier=both-addresses-and-ports:3/2 protocol=udp
  48.  
  49. add action=mark-routing chain=prerouting comment="PCC RULE —- MARK – HTTP ROUTE" connection-mark=http_pppoe_1 disabled=yes new-routing-mark=pppoe_1 passthrough=yes
  50. add action=mark-routing chain=prerouting comment="" connection-mark=http_pppoe_2 disabled=yes new-routing-mark=pppoe_1 passthrough=yes
  51. add action=mark-routing chain=prerouting comment="" connection-mark=http_pppoe_3 disabled=yes new-routing-mark=pppoe_2 passthrough=yes
  52.  
  53. add action=mark-routing chain=prerouting comment="PCC RULE MARK NON HTTP ROUTE" connection-mark=non.http_pppoe_1 disabled=yes new-routing-mark=pppoe_1 passthrough=yes
  54. add action=mark-routing chain=prerouting comment="" connection-mark=non.http_pppoe_2 disabled=yes new-routing-mark=pppoe_1 passthrough=yes
  55. add action=mark-routing chain=prerouting comment="" connection-mark=non.http_pppoe_3 disabled=yes new-routing-mark=pppoe_2 passthrough=yes
  56.  
  57.  
  58. /ip route
  59. add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=Speedy routing-mark=pppoe_1 scope=30 target-scope=10
  60. add check-gateway=ping disabled=yes distance=1 dst-address=0.0.0.0/0 gateway=Speedy1 routing-mark=pppoe_2 scope=30 target-scope=10
Advertisement
Add Comment
Please, Sign In to add comment