Friday, August 31, 2012

Policy Based Routing with IP SLA

To start this, a reminder that when using routers as simulated hosts, make sure you are turning ip routing OFF. And set a default gateway.

The client hosts are routers here:



Router 1


ip sla monitor 1
 type echo protocol ipIcmpEcho 200.1.1.2
 timeout 1000
 frequency 3
ip sla monitor schedule 1 life forever start-time now
!
!
!
track 1 rtr 1 reachability
!
!
interface Serial0/0
 ip address 200.1.1.1 255.255.255.0
 serial restart-delay 0
!
interface Serial0/1
 ip address 201.1.1.1 255.255.255.0
 serial restart-delay 0
!
interface Serial0/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial0/3
 no ip address
 shutdown
 serial restart-delay 0
!
interface FastEthernet1/0
 ip address 192.168.1.1 255.255.255.0
 ip policy route-map POLICY
 duplex auto
 speed auto
!
interface FastEthernet2/0
 no ip address
 shutdown
 duplex auto
 speed auto
!
ip local policy route-map ROUTER_TRAFFIC
no ip http server
!
!
!
!
ip access-list extended CLIENT1
 permit ip host 192.168.1.20 any
ip access-list extended CLIENT2
 permit tcp host 192.168.1.21 any eq telnet
 permit tcp host 192.168.1.21 any eq 443
ip access-list extended ROUTER
 permit ip any any
route-map POLICY permit 10
 match ip address CLIENT1
 set ip next-hop 201.1.1.2
!
route-map POLICY permit 20
 match ip address CLIENT2
 set ip next-hop 200.1.1.2
!
route-map POLICY permit 30
 set ip next-hop 201.1.1.2
!
route-map ROUTER_TRAFFIC permit 10
 match ip address ROUTER
 set ip next-hop verify-availability 200.1.1.2 10 track 1
 set ip next-hop 201.1.1.2

Router 2


interface Serial0/0
 ip address 200.1.1.2 255.255.255.0
 shutdown
 serial restart-delay 0


Router 3


interface Serial0/0
 ip address 201.1.1.2 255.255.255.0
 serial restart-delay 0

Router 4


no ip routing
!
!
no ip cef
no ip domain lookup
ip domain name lab.local
!
!
!
!
!
!


interface FastEthernet0/0
 ip address 192.168.1.20 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 no ip route-cache
 shutdown
 duplex auto
 speed auto
!
ip default-gateway 192.168.1.1




Router 5


no ip routing
!
!
no ip cef
no ip domain lookup
ip domain name lab.local
!
!
!
!
!
!


interface FastEthernet0/0
 ip address 192.168.1.21 255.255.255.0
 no ip route-cache
 duplex auto
 speed auto
!
interface FastEthernet1/0
 no ip address
 no ip route-cache
 shutdown
 duplex auto
 speed auto
!
ip default-gateway 192.168.1.1

No comments:

Post a Comment