Hi David,

Actually I do not want to track the interface status but ensure that a ping
is working.
This is because the router will not be directly connected to the router to
monitor.

Here's a quick overview of the lab setup:

    Se0/1:0        Se0/1:0
        \              |
         \             |
          R1 --1000--- R2
           \          /  
            \        /
             10    1000 
              \    /
               \  /
                  R3

3 routers connected using OSPF with the specified costs and a full mesh BGP
network.
I want R1 to stop announcing route to se0/1:0 IP range when the IP address
of R2 (10.0.1.2) can't be pinged anymore.
At that time, the traffic destinated to that range should go to R2.

You can find the results of show track when the IP address is reachable or
not in attachment (R1_commands).
Also the config of each router is in attachment.

Thanks for your help,

-----Original Message-----
From: David Prall [mailto:[email protected]] 
Sent: mardi 29 novembre 2011 15:02
To: 'Henry-Nicolas Tourneur'; [email protected]
Subject: RE: [c-nsp] Conditionnal routing based on OSPF / IP SLA

So why not just track the interface status? The static should go away if the
interface goes down? What does "sh track" show you? On your track object, I
always use state instead of reachability.

The following should accomplish what you are trying to do. If se0/1:0 is
down then it won't be advertised.
ip route 17.4.240.40 255.255.255.240 Se0/1:0 10.0.1.2 tag 1755

David

--
http://dcp.dcptech.com



-----Original Message-----
From: Henry-Nicolas Tourneur [mailto:[email protected]] 
Sent: Tuesday, November 29, 2011 3:30 AM
To: 'David Prall'; [email protected]
Subject: RE: [c-nsp] Conditionnal routing based on OSPF / IP SLA

Hello David,

I tried the following, pretty straightforward setup.
I'v a full mesh iBGP running on 3 lab routers and OSPF between them (simple
triangle).

The IP to be checked is on a /30 in between R1 & R2, when this go down, I
want R1 to stop announcing the ip route (should disappear on R3).
The tag 1755 is to force the route to be advertised through iBGP and not
OSPF.

If the IP to be checked goes down, I can see that the SLA Monitor status
goes to down but yet, R1 keep advertising the route.

Any idea why? 

ip sla monitor 1
 type echo protocol ipIcmpEcho 10.0.1.2
 timeout 800
 frequency 2
!

ip sla monitor schedule 1 life forever start-time now
track 100 rtr 1 reachability

ip route 17.4.240.40 255.255.255.240 Se0/1:0 tag 1755 track 100

Thanks in advance :)

Henry-Nicolas Tourneur.


-----Original Message-----
From: David Prall [mailto:[email protected]] 
Sent: jeudi 24 novembre 2011 19:20
To: 'Henry-Nicolas Tourneur'; [email protected]
Subject: RE: [c-nsp] Conditionnal routing based on OSPF / IP SLA

You can do this with track objects and static routing, then redistribute the
static into ospf. You could use a conditional route-map like they do in the
example for default as well. But I think putting a static in and
redistributing it will be much easier.

David

--
http://dcp.dcptech.com



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Henry-Nicolas
Tourneur
Sent: Thursday, November 24, 2011 10:28 AM
To: [email protected]
Subject: [c-nsp] Conditionnal routing based on OSPF / IP SLA

Hi all,

 

I'm currently trying to make a Cisco router to announce one network
statement based on the result of an IP Sla probe.

Currently, I found this tutorial:

 

http://hackingcisco.blogspot.com/2011/03/lab-33-ospf-conditional-default-rou
ting.html

 

But it's only for "default-information", I would need this for a particular
route.

 

Does anybody have an idea how to do this?

 

Thanks and regards,

 

Henry-Nicolas Tourneur.

_______________________________________________
cisco-nsp mailing list  [email protected]
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/
version 12.4
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
logging buffered 65536 debugging
logging console informational
!
!
aaa session-id common
clock timezone CET 1
clock summer-time CET recurring last Sun Mar 2:00 last Sun Oct 3:00
no ip source-route
ip cef
!
!
!
controller E1 0/1
 channel-group 0 timeslots 1-31
!
no ip domain lookup

!
!
interface Loopback0
 ip address 172.16.10.2 255.255.255.255
!

interface FastEthernet0/0
 no shut
 cdp enable
 description #backbone: R1
 duplex auto
 speed auto
 ip address 10.0.1.2 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 1000
 ip ospf hello-interval 1
!

interface FastEthernet0/1
 no shut
 cdp enable
 description #backbone: R3
 duplex auto
 speed auto
 ip address 10.0.3.1 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 1000
 ip ospf hello-interval 1
!
interface Serial0/1:0
 no shut
 cdp enable
 description CLIENT
 ip address 17.4.240.241 255.255.255.240
 no ip redirects
 no ip proxy-arp
!

router ospf 1755
 router-id 172.16.10.2
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 redistribute static metric 1 metric-type 1 subnets route-map redist_ospf_static
 passive-interface default
 network 172.16.10.2  0.0.0.0 area 0
 network 10.0.1.0 0.0.0.3 area 0
 network 10.0.3.0 0.0.0.3 area 0
 no passive-interface FastEthernet0/0
 no passive-interface FastEthernet0/1
!
router bgp 65535
 no synchronization
 bgp router-id 172.16.10.2
 bgp log-neighbor-changes
 network 17.4.240.240 mask 255.255.255.240
 neighbor iBGP peer-group
 neighbor iBGP remote-as 65535
 neighbor iBGP update-source Loopback0
 neighbor 172.16.10.1 peer-group iBGP
 neighbor 172.16.10.1 description R1
 neighbor 172.16.10.3 peer-group iBGP
 neighbor 172.16.10.3 description R3
 no auto-summary
!
ip forward-protocol nd

route-map redist_ospf_static deny 10
 match tag 1755
!
route-map redist_ospf_static permit 20
!
!
access-list 10 permit 17.4.240.240 0.0.0.15
access-list 10 permit 17.4.240.0 0.0.0.127
access-list 10 deny   any
access-list 20 permit 17.4.240.0 0.0.0.31
access-list 20 permit 17.4.240.240 0.0.0.15
access-list 20 deny   any
!
control-plane
!
!

alias exec sif sh int | i Descr|protocol|CRC
alias exec sib sh ip int brief
alias exec sir sh ip route
alias exec sid sh int desc
alias exec tm term mon
alias exec tnm term no mon
alias exec ua undebug all
alias exec sion show ip ospf ne
alias exec sal sh ip access-list
alias exec sc sh diag | i Slot|port|FRU|Serial
alias exec srro sh run | begin ^router ospf
alias exec srrb sh run | begin ^router bgp
alias exec sri sh run int
alias exec svb sh vlan brief
alias exec smv sh mac-address vlan
alias exec smi sh mac-address interface
!
line con 0
 exec-timeout 30 0
 logging synchronous
line aux 0
 transport input all
 transport output none
 stopbits 1
line vty 0 4
 exec-timeout 30 0
 logging synchronous
!
end
version 12.4
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
logging buffered 65536 debugging
logging console informational
!
!
aaa session-id common
clock timezone CET 1
clock summer-time CET recurring last Sun Mar 2:00 last Sun Oct 3:00
no ip source-route
ip cef
!
!
!
!
no ip domain lookup

!
!
interface Loopback0
 ip address 172.16.10.3 255.255.255.255
!

interface FastEthernet0/0
 no shut
 cdp enable
 description #backbone: R2
 duplex auto
 speed auto
 ip address 10.0.3.2 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 1000
 ip ospf hello-interval 1
!

interface FastEthernet0/1
 no shut
 cdp enable
 description #backbone: R1
 duplex auto
 speed auto
 ip address 10.0.2.2 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 10
 ip ospf hello-interval 1
!


router ospf 1755
 router-id 172.16.10.3
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 redistribute static metric 1 metric-type 1 subnets route-map redist_ospf_static
 passive-interface default
 network 172.16.10.3 0.0.0.0 area 0
 network 10.0.2.0 0.0.0.3 area 0
 network 10.0.3.0 0.0.0.3 area 0
 no passive-interface FastEthernet0/0
 no passive-interface FastEthernet0/1
!
router bgp 65535
 no synchronization
 bgp router-id 172.16.10.3
 bgp log-neighbor-changes
 neighbor iBGP peer-group
 neighbor iBGP remote-as 65535
 neighbor iBGP update-source Loopback0
 neighbor 172.16.10.1 peer-group iBGP
 neighbor 172.16.10.1 description R1
 neighbor 172.16.10.2 peer-group iBGP
 neighbor 172.16.10.2 description R2
 no auto-summary
!
ip forward-protocol nd

route-map redist_ospf_static deny 10
 match tag 1755
!
route-map redist_ospf_static permit 20
!
!
access-list 10 permit 17.4.240.240 0.0.0.15
access-list 10 permit 17.4.240.0 0.0.0.127
access-list 10 deny   any
access-list 20 permit 17.4.240.0 0.0.0.31
access-list 20 permit 17.4.240.240 0.0.0.15
access-list 20 deny   any
!
control-plane
!
!

alias exec sif sh int | i Descr|protocol|CRC
alias exec sib sh ip int brief
alias exec sir sh ip route
alias exec sid sh int desc
alias exec tm term mon
alias exec tnm term no mon
alias exec ua undebug all
alias exec sion show ip ospf ne
alias exec sal sh ip access-list
alias exec sc sh diag | i Slot|port|FRU|Serial
alias exec srro sh run | begin ^router ospf
alias exec srrb sh run | begin ^router bgp
alias exec sri sh run int
alias exec svb sh vlan brief
alias exec smv sh mac-address vlan
alias exec smi sh mac-address interface
!
line con 0
 exec-timeout 30 0
 logging synchronous
line aux 0
 transport input all
 transport output none
 stopbits 1
line vty 0 4
 exec-timeout 30 0
 logging synchronous
!
end
version 12.4
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
logging buffered 65536 debugging
logging console informational
!
!
aaa session-id common
clock timezone CET 1
clock summer-time CET recurring last Sun Mar 2:00 last Sun Oct 3:00
no ip source-route
ip cef
!
!
controller E1 0/1
 channel-group 0 timeslots 1-31
!
!
!
no ip domain lookup

!
!
interface Loopback0
 ip address 172.16.10.1 255.255.255.255
!

interface FastEthernet0/0
 no shut
 cdp enable
 description #backbone: R2
 duplex auto
 speed auto
 ip address 10.0.1.1 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 1000
 ip ospf hello-interval 1
!

interface FastEthernet0/1
 no shut
 cdp enable
 description #backbone: R3
 duplex auto
 speed auto
 ip address 10.0.2.1 255.255.255.252
 no ip redirects
 no ip proxy-arp
 ip ospf cost 10
 ip ospf hello-interval 1
!
interface Serial0/1:0
 no shut
 cdp enable
 description CLIENT
 ip address 17.4.240.241 255.255.255.240
 no ip redirects
 no ip proxy-arp
!
router ospf 1755
 router-id 172.16.10.1
 log-adjacency-changes
 auto-cost reference-bandwidth 1000
 redistribute static metric 1 metric-type 1 subnets route-map redist_ospf_static
 passive-interface default
 network 172.16.10.1 0.0.0.0 area 0
 network 10.0.1.0 0.0.0.3 area 0
 network 10.0.2.0 0.0.0.3 area 0
 no passive-interface FastEthernet0/0
 no passive-interface FastEthernet0/1
!
router bgp 65535
 no synchronization
 bgp router-id 172.16.10.1
 bgp log-neighbor-changes
 neighbor iBGP peer-group
 neighbor iBGP remote-as 65535
 neighbor iBGP update-source Loopback0
 neighbor 172.16.10.2 peer-group iBGP
 neighbor 172.16.10.2 description R2
 neighbor 172.16.10.3 peer-group iBGP
 neighbor 172.16.10.3 description R3
 no auto-summary
!
ip forward-protocol nd

ip sla monitor 1
 type echo protocol ipIcmpEcho 10.0.1.2
 timeout 800
 frequency 2
!

ip sla monitor schedule 1 life forever start-time now
track 100 rtr 1 state

ip route 17.4.240.240 255.255.255.240 Se0/1:0 tag 1755 track 100



route-map redist_ospf_static deny 10
 match tag 1755
!
route-map redist_ospf_static permit 20
!
!
access-list 10 permit 17.4.240.240 0.0.0.15
access-list 10 permit 17.4.240.0 0.0.0.127
access-list 10 deny   any
access-list 20 permit 17.4.240.0 0.0.0.31
access-list 20 permit 17.4.240.240 0.0.0.15
access-list 20 deny   any
!
control-plane
!
!

alias exec sif sh int | i Descr|protocol|CRC
alias exec sib sh ip int brief
alias exec sir sh ip route
alias exec sid sh int desc
alias exec tm term mon
alias exec tnm term no mon
alias exec ua undebug all
alias exec sion show ip ospf ne
alias exec sal sh ip access-list
alias exec sc sh diag | i Slot|port|FRU|Serial
alias exec srro sh run | begin ^router ospf
alias exec srrb sh run | begin ^router bgp
alias exec sri sh run int
alias exec svb sh vlan brief
alias exec smv sh mac-address vlan
alias exec smi sh mac-address interface
!
line con 0
 exec-timeout 30 0
 logging synchronous
line aux 0
 transport input all
 transport output none
 stopbits 1
line vty 0 4
 exec-timeout 30 0
 logging synchronous
!
end
R1#sh track 
Track 100
  Response Time Reporter 1 state
  State is Up
    1 change, last change 00:02:39
  Latest operation return code: OK
  Latest RTT (millisecs) 1
  Tracked by:
    STATIC-IP-ROUTING 0
R1#
R1#
R1#
R1#
*Mar  2 05:57:05.049 CET: %OSPF-5-ADJCHG: Process 1755, Nbr 172.16.10.2 on 
FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired
*Mar  2 05:57:05.409 CET: %TRACKING-5-STATE: 100 rtr 1 state Up->Down
*Mar  2 05:57:05.885 CET: %LINEPROTO-5-UPDOWN: Line protocol on Interface 
FastEthernet0/0, changed state to down
R1#
R1#
R1#sh track 
Track 100
  Response Time Reporter 1 state
  State is Down
    2 changes, last change 00:00:03
  Latest operation return code: Timeout
  Tracked by:
    STATIC-IP-ROUTING 0
R1#
R1#
R1#sh ip bgp nei 172.16.10.3 advertised-routes 
BGP table version is 4, local router ID is 172.16.10.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 17.4.240.240/28
                    0.0.0.0                  0         32768 i

Total number of prefixes 1 
R1#
_______________________________________________
cisco-nsp mailing list  [email protected]
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/

Reply via email to