cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1360
Views
0
Helpful
2
Replies

Default URL redirector

rngai
Level 1
Level 1

Hello there,

I would like to setup a test case to redirect all incoming http to VIP (with serverfarm behind it) base on 2 conditions below. Can someone point me to the right direction?

Condition 1 - match source IP (eg: 10.1.1.0/24)

AND

Condition 2 - match destination VIP on port http

Result:

Redirect to another web server (eg: www.yahoo.com)

No URL rewrite is required but simple http redirector base on source IP reaching VIP in Cisco ACE, then forward it back to www.yahoo.com. All subsequent packets from sender will communicate directly with www.yahoo.com without going back to Cisco ACE (which I hope it work that way).

Now here's what I think will work:

class-map match-all WEB_VIP

  2 match virtual-address 10.10.10.10 tcp eq www

class-map type http loadbalance match-any redirect-l7

  2 match http url /%p

policy-map type loadbalance first-match redirect-policy

  class redirect-l7

    serverfarm redirect-sf

serverfarm redirect redirect-sf

  rserver redirect-sf

    inservice

rserver redirect redirect-sf

  webhost-redirection http://www.yahoo.com 301

  inservice

I think there's issue somewhere but I can't spot it myself.

Thanks for your tips!

Cheers mate.

Ryan

2 Replies 2

Surya ARBY
Level 4
Level 4

Create a VIP on port 80

Create a class-map matching the subnet you want (let's say ""source-ip-redirect")

then :

policy-map type loadbalance first-match redirect-policy

  class source-ip-redirect

    serverfarm redirect-sf

  class-default

    serverfarm MAIN

that's all.

Hi Surya,

Looks simple, here's my revised config. Looks ok?

####VIP on port 80####

class-map match-all WEB_VIP

  2 match virtual-address 10.10.10.10 tcp eq www

####Match any URI on VIP above###

class-map type http loadbalance match-any redirect-l7

  2 match http url /%p

####match http with source subnet###

class-map match-any ip-source-redirect

  match protocol http source-address 192.168.1.0 255.255.255.0

  match protocol http source-address 172.16.0.0 255.255.0.0

###set redirection to yahoo.com###

policy-map type loadbalance first-match redirect-policy

  class source-ip-redirect

    serverfarm redirect-sf

  class-default

    serverfarm MAIN

rserver redirect redirect-sf

  webhost-redirection http://www.yahoo.com 301

  inservice

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: