Mikrotik Webproxy with PCC

Usually when you enable web proxy on pcc, it wont work. To make it work you have to mark web proxy connection in output chain, and exclude port 80 traffic from pre-routing PCC rules. Example is as below. (I assume you have dual wan pcc already configured and in running state


Add following rules (Output chain)
/ip firewall mangle
add action=mark-connection chain=output comment=”Marking Web Proxy Connection for WAN-1″ disabled=no dst-port=80 new-connection-mark=WAN1_conn passthrough=yes per-connection-classifier=\    both-addresses-and-ports:2/0 protocol=tcp
    both-addresses-and-ports:2/1 protocol=tcp
    per-connection-classifier=both-addresses-and-ports:2/0 protocol=tcp
add action=mark-connection chain=prerouting comment=”Excluding Port 80 from PCC – WAN2″ disabled=no dst-address-type=!local dst-port=!80 in-interface=LAN new-connection-mark=WAN2_conn passthrough=yes \
    per-connection-classifier=both-addresses-and-ports:2/1 protocol=tcp
    max-server-connections=600 parent-proxy=0.0.0.0 parent-proxy-port=0 port=8080 serialize-connections=no src-address=0.0.0.0
add action=redirect chain=dstnat comment=”Redirect port 80 request to Web Proxy” disabled=no dst-port=80 protocol=tcp to-ports=8080



add action=mark-connection chain=output comment=”Marking Web Proxy Connection for WAN-2″ disabled=no dst-port=80 new-connection-mark=WAN2_conn passthrough=yes per-connection-classifier=\
.
Now exclude port 80 from the PCC rules in pre-routing chain.
add action=mark-connection chain=prerouting comment=”Excluding Port 80 from PCC – WAN1″ disabled=no dst-address-type=!local dst-port=!80 in-interface=LAN new-connection-mark=WAN1_conn passthrough=yes \

Now Enable Web proxy.
/ip proxy
set always-from-cache=no cache-administrator=webmaster cache-hit-dscp=4 cache-on-disk=yes enabled=yes max-cache-size=unlimited max-client-connections=600 max-fresh-time=3d \



Now redirect users port 80 traffic to web proxy by creating a NAT rule so all users browsing (port 80) request should automatically be redirected to mikrotik web proxy, (akaTransparent Proxy) (Move this rule at end in NAT section)
/ip firewall nat
add action=redirect chain=dstnat comment=”Redirect port 80 request to Web Proxy” disabled=no dst-port=80 protocol=tcp to-ports=8080

All Done
Regards,
HaK


Comments

  1. This is not working then i search more hard and find the below link. This is working perfectly.

    http://step-technology.blogspot.com/2011/05/load-balance-using-pcc-method-in.html

    But again now I work more for on above script i found little bit mistake in redirect proxy rule and some route marking problem

    but i m unable to identify route problem but can be redirect proxy rule problem

    in proxy redirect rule in.interface is not included kindly add the lan interface.

    ReplyDelete
  2. Sorry guys! I am wrong the above script is not working. due to this Just PCC is not working and doesn't use both ISP together.

    Thanks

    ReplyDelete
  3. before applying PCC you need to make sure interface name according to above script. further you can also achieve this by using this.

    http://hak786.blogspot.com/2014/09/ecmp-load-balancing-simple-and-easy.html

    ReplyDelete
  4. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! periodic expenses examples

    ReplyDelete
  5. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. how much is half a gallon in oz

    ReplyDelete
  6. You actually make it look so easy with your performance but I find this matter to be actually something which I think I would never comprehend. It seems too complicated and extremely broad for me. I'm looking forward for your next post, I’ll try to get the hang of it! how many water bottles equal 8 oz

    ReplyDelete
  7. I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. ortho press n set mouse trap

    ReplyDelete
  8. Your work is very good and I appreciate you and hopping for some more informative posts how to remove a hickey right away

    ReplyDelete
  9. This is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck. cost accumulation

    ReplyDelete

Post a Comment

Popular posts from this blog

Dual Wan Load balacing with failover mikrotik

Configure Static IP Address (CLI) on Ubuntu 18.04.5 LTS