10-24-2011 02:25 PM - edited 03-07-2019 03:01 AM
I have a cisco 2821 router configured with NAT to support SIP ALG.
The basic setup looks like this:
int gi0/0
ip address 1.1.1.1 255.255.255.0
ip nat outside
description - inteface facing SIP provider on public internet
intgi0/1
ip address 10.100.0.1 255.255.255.0
ip nat inside
description - interface facing private LAN with OSPF running
default gateway
ip route 0.0.0.0 0.0.0.0 2.2.2.2
static route to provider sip network servers
ip route 3.3.3.3 255.255.255.255 4.4.4.4
To get to private network side (gi0/1)the router uses routes learned through ospf.
router ospf 10
router-id 10.100.0.1
log-adjacency-changes
area 0.0.0.0 authentication message-digest
redistribute static metric-type 1 subnets
network 10.100.0.1 0.0.0.0 area 0.0.0.0
network 10.100.0.0 0.0.255.255 area 0.0.0.0
!
On lan there is different default gateway to get to the internet.
Above router is used to get to the sip provider network only.
I want to be able to distrbute from this router through OSPF only specific 3.3.3.3 route so LAN routes to sip through this router.
In above setup it will work fine, but if the provider has some issues the route will not be removed and the route learned from backup network will have higher metric so not working 3.3.3.3 route will be in the table.
Is there a way to enable some kind of tracking of 3.3.3.3 route and only had it in the routing table when 3.3.3.3 is up?
I know if gi0/0 would be running BGP it would not be an issue but there is no routing protocol on the provider side.
thx
Solved! Go to Solution.
10-24-2011 10:57 PM
Bart,
I have put this in the lab for you. I tested this on a 3640 image. I have setup a simple network.
R1<---> R2 [I configured a loopback on R2 with an ip of 2.2.2.2]
R1#sh run
Building configuration...
Current configuration : 746 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip sla monitor 1
type echo protocol ipIcmpEcho 2.2.2.2
ip sla monitor schedule 1 life forever start-time now
!
!
!
track 1 rtr 1 reachability
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
no ip http server
no ip http secure-server
ip route 2.2.2.2 255.255.255.255 192.168.1.2 track 1
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
once I shut the loop back on R2 , the static route on R1 disappears.
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
S 2.2.2.2 [1/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R1#
*Mar 1 00:12:46.191: %TRACKING-5-STATE: 1 rtr 1 reachability Up->Down
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0 << static route disapppeared
HTH
Regards
Kishore
Pleaase rate if helps
10-24-2011 03:05 PM
Tracked ip route with an ip sla, with a route map calling an acl to match the route.
Sent from Cisco Technical Support iPad App
10-24-2011 04:11 PM
can you show me an example how to accomplish this or provide any good link how this is done?
thx
10-24-2011 10:08 PM
Hi Bart,
Hope these links helps. Also please note that the commands change with the IOS. So, please check your IOS and you should be able to find the feature
http://docwiki.cisco.com/wiki/IP_SLA_Tracking_with_Configuration_Example
http://www.cciecandidate.com/?p=389
HTH
Regards,
Kishore
Please rate if helps
10-24-2011 10:57 PM
Bart,
I have put this in the lab for you. I tested this on a 3640 image. I have setup a simple network.
R1<---> R2 [I configured a loopback on R2 with an ip of 2.2.2.2]
R1#sh run
Building configuration...
Current configuration : 746 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
ip sla monitor 1
type echo protocol ipIcmpEcho 2.2.2.2
ip sla monitor schedule 1 life forever start-time now
!
!
!
track 1 rtr 1 reachability
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
no ip http server
no ip http secure-server
ip route 2.2.2.2 255.255.255.255 192.168.1.2 track 1
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
!
end
once I shut the loop back on R2 , the static route on R1 disappears.
R1#ping 2.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
S 2.2.2.2 [1/0] via 192.168.1.2
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R1#
*Mar 1 00:12:46.191: %TRACKING-5-STATE: 1 rtr 1 reachability Up->Down
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, FastEthernet0/0 << static route disapppeared
HTH
Regards
Kishore
Pleaase rate if helps
10-25-2011 11:13 AM
thank you guys, tested and worked as expected
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide