cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
648
Views
0
Helpful
3
Replies

Match source-address and url

mrkasuj
Level 1
Level 1


I have an existing policy-map with vip and port 80. Now I need to do:

1. Match pool of ip address and url /abc then redirect to url /abc1
2. If url is ok but ip is out of the pool then redirect to url /abc2

It's probably possible to achieve but I have problem with mixing class maps (L4 and L7). Please advice how to do it.

Thank you.

3 Replies 3

Kanwaljeet Singh
Cisco Employee
Cisco Employee

HI Kamil,

Something like below. Please try and let me know if it helps.

rserver redirect red
  webhost-redirection www.abc1.com
  inservice

rserver redirect red1
  webhost-redirection www.abc2.com
  inservice

serverfarm redirect red
  rserver red
    inservice

serverfarm redirect red1
  rserver red1
    inservice

class-map type http loadbalance match-all url
  2 match http url abc
  4 match source-address 2.2.2.2 255.255.255.0

class-map type http loadbalance match-all url1
  2 match http url abc

 policy-map type loadbalance first-match url
  class url
    serverfarm red
  class url1
    serverfarm red1
  class class-default
    serverfarm xxxx

 

Regards,

Kanwal

Note: Please mark answers if they are helpful

Hi Kanwal, it looks ok. Thank you,

In this configuration is it possible to somehow secure the serverfarm which redirects to url /abc1 from someone who will try entering http://myserver/abc1 directly?

Hi Kamil,

If user comes directly then it will match the VIP and class-map condition and would be loadbalanced to a different serverfarm. Any user coming with /abc will be redirected.

Regards,

Kanwal

Note: Please mark answers if they are helpful.