cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
678
Views
0
Helpful
6
Replies

Load balancing HTTP /HTTPs

shahbaz1981
Level 1
Level 1

Hi all,

i have a query regarding load balancing .

i have two isp , 

my local user brows google.com it should be go to  ISP1

but when they  brows yahoo.com it should be go to ISP2

kindly guide me.i am using cisco router 3825 

6 Replies 6

Joseph W. Doherty
Hall of Fame
Hall of Fame

PBR (policy based routing) might provide the solution you seek, although the kind of load balancing you seem to require is a real pain to maintain.

Generally, it's easier to just "round-robin" flows to your ISPs.

If your platform (and licensing) supports it, PfR (performance routing) can dynamically load balance.

hi ,

Thanks for your support , i will check it and share the result .

 

Hello,

something like the below should work:

class-map match-any CLASS_GOOGLE
 match protocol http host "google.com"
 match protocol secure-http host "google.com"
!
class-map match-any CLASS_YAHOO
 match protocol http host "yahoo.com"
 match protocol secure-http host "yahoo.com"
!
policy-map MARK_GOOGLE
 class CLASS_GOOGLE
  set ip dscp 1
!
policy-map MARK_YAHOO
 class CLASS_YAHOO
  set ip dscp 2
!
access-list 100 deny ip any any dscp 1
access-list 100 permit ip any any
!
route-map test REDIRECT_URL 10
 match ip address 100
 set ip next-hop 201.100.100.100
!
access-list 101 deny ip any any dscp 2
access-list 101 permit ip any any
!
route-map test REDIRECT_URL 20
 match ip address 101
 set ip next-hop 202.200.100.100
!
interface GigabitEthernet0/0
 description LAN interface
 ip policy route-map REDIRECT_URL

A nice example of PBR although I don't believe it deals with link failure.(?)

Indeed, link failure isn't covered.
A simple EEM script could work:

event manager applet remove_pbr
event tag e1 syslog pattern "Line protocol on Interface GigabitEthernet2/0, changed state to down"
event tag e2 syslog pattern "Line protocol on Interface GigabitEthernet3/0, changed state to down"
trigger
correlate event e1 or event e2
exit
action 1.0 cli command "enable"
action 1.5 cli command "config t"
action 2.0 cli command "interface GigabitEthernet0/0"
action 2.5 cli command "no ip policy route-map REDIRECT_URL"
action 3.0 cli command "end"
action 3.5 cli command "wr mem"

event manager applet add_pbr
event tag e1 syslog pattern "Line protocol on Interface GigabitEthernet2/0, changed state to up"
event tag e2 syslog pattern "Line protocol on Interface GigabitEthernet3/0, changed state to up"
trigger
correlate event e1 or event e2
exit
action 1.0 cli command "enable"
action 1.5 cli command "config t"
action 2.0 cli command "interface GigabitEthernet0/0"
action 2.5 cli command "ip policy route-map REDIRECT_URL"
action 3.0 cli command "end"
action 3.5 cli command "wr mem"

To OP, and now you might begin to understand why I wrote ". . . a real pain to maintain."  ;)

Review Cisco Networking for a $25 gift card