Friday, August 16, 2013

QOS Policy-Based Routing (PBR)

One important selection routing is PBR. What is actually PBR for ? The main purpose PBR is route traffic based-on source. The Routing protocol is route traffic based-on destination. Lets check out the example of PBR.

#### Define route-map that specifies the match criteria

IOS(config)#
access-list 10 permit 172.16.135.1
access-list 20 permit 172.16.135.3
!
route-map PBR-TEST permit 10
 match ip address 10
 set ip next-hop 172.16.24.2
!
route-map PBR-TEST permit 20
 match ip address 20
 set ip next-hop 172.16.24.4

#### Apply to interface

IOS(config-if)#
interface FastEthernet1/1
 description To-Router
 ip address 172.16.135.2 255.255.255.0
 ip policy route-map PBR-TEST
end

#### Verify PBR

#### Before Apply

IOS-135-1#traceroute 172.16.25.1 ttl 1 2

Type escape sequence to abort.
Tracing the route to 172.16.25.1

  1 172.16.135.2 4 msec 0 msec 0 msec
  2 172.16.24.4 0 msec 0 msec 4 msec
  
IOS-135-3#traceroute 172.16.25.1 ttl 1 2

Type escape sequence to abort.
Tracing the route to 172.16.25.1

  1 172.16.135.2 0 msec 4 msec 0 msec
  2 172.16.24.2 0 msec 0 msec 0 msec
  
#### After Apply

IOS#show ip access-lists 
Standard IP access list 10
    10 permit 172.16.135.1 (282 matches)
Standard IP access list 20
    10 permit 172.16.135.3 (102 matches)

IOS#show route-map
route-map PBR-TEST, permit, sequence 10
  Match clauses:
    ip address (access-lists): 10 
  Set clauses:
    ip next-hop 172.16.24.2
  Policy routing matches: 282 packets, 16920 bytes
route-map PBR-TEST, permit, sequence 20
  Match clauses:
    ip address (access-lists): 20 
  Set clauses:
    ip next-hop 172.16.24.4
  Policy routing matches: 102 packets, 6120 bytes

IOS#show ip policy 
Interface      Route map
FastEthernet1/1    PBR-TEST
  
IOS-135-1#traceroute 172.16.25.1 ttl 1 2

Type escape sequence to abort.
Tracing the route to 172.16.25.1

  1 172.16.135.2 0 msec 4 msec 0 msec
  2 172.16.24.2 0 msec 0 msec 0 msec
  
IOS-135-3#traceroute 172.16.25.1 ttl 1 2

Type escape sequence to abort.
Tracing the route to 172.16.25.1

  1 172.16.135.2 0 msec 8 msec 4 msec
  2 172.16.24.4 0 msec 4 msec 0 msec

No comments: