Community discussions

MikroTik App
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Forward url to a specific WAN in pcc loadblancing

Thu May 21, 2015 11:26 am

Hi.

I want to know How to forward a URL request Coming from Clients to PCC Load blancer to a Specific WAN port.

Bellow image is attached

Spose from Client Side if i enter a url http://192.168.1.1 it should froward to WAN1 and if i type url http://172.16.1.1 then it should forward to WAN2 similarly if i type http://10.10.1.1 then it should forward to WAN3

i need the firwal rules to forward such URLs to a specific WAN ports in PCC LOAD blancer
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Forward url to a specific WAN in pcc loadblancing

Thu May 21, 2015 11:30 am

Image
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Forward url to a specific WAN in pcc loadblancing

Thu May 21, 2015 12:47 pm

Force it on RB2011 by using routing-mark, the same way as you're already doing but instead of using PCC classifier to divide connections, use dst-address as criteria.

Those mange rules should be before the PCC ones.
 
farazhamzaa
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 74
Joined: Sun Apr 01, 2012 9:31 am

Re: Forward url to a specific WAN in pcc loadblancing

Fri May 22, 2015 8:59 am

Yeap you are saying right

but kindly can you please define it as in before coding so that i can understand and add the rules easily

/ip firewall mangle

add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Forward url to a specific WAN in pcc loadblancing

Fri May 22, 2015 11:10 am

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

add chain=prerouting in-interface=Local dst-address=192.168.1.1 action=mark-connection new-connection-mark=WAN1_conn passthrough=yes

add action=mark-routing chain=prerouting dst-address-type=!local in-interface=Local connection-mark=WAN1_conn new-routing-mark=to_WAN1 passthrough=no

/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_WAN1 check-gateway=ping
You should add these after each WANx connection classifier existing one, and before the mark-routing one.