Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

rsh setup? or any other method for automating?

Hi,

I need to execute a set of commands in the cisco router for automating.

I got two ISP's and in my router I got default route for only one ISP. If this ISP goes down, I need to remove the deafult route for this ISP and add the default route for the other ISP. I need some kind of script to do this while I am not at office (may be using rsh command). Could someone guide me for this setup?

Thanks in advance,

Ribin Jones S.B

1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

Ribin

As expected syntax has changed, actually with 12.4(20)T, use this instead -

track 10 ip sla 1 reachability

as for switching over if over a certain time, i'm not sure. I have never done this as it can lead to link flapping ie. one ping takes a little longer and then the router switches routes and then the next ping works fine and it switches back.

I suspect you may be able to, if i get time i'll have a look, as there are options like threshold that you can configure under the ip sla bit.

Probably worth testing this first though.

Jon

14 REPLIES
Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

ribin.jones wrote:

Hi,

I need to execute a set of commands in the cisco router for automating.

I got two ISP's and in my router I got default route for only one ISP. If this ISP goes down, I need to remove the deafult route for this ISP and add the default route for the other ISP. I need some kind of script to do this while I am not at office (may be using rsh command). Could someone guide me for this setup?

Thanks in advance,

Ribin Jones S.B

Ribin

There is a function called IP SLA that comes with IOS that can do this for you automatically ie. if the primary link goes down the route is removed and a route for the secondary link is automatically put into the routing table. If the primary comes back up then the secondary route is removed and replaced with the primary.

What router model do you have and what IOS version/feature set are you running ?

Jon

New Member

Re: rsh setup? or any other method for automating?

Hi,

Router model - Cisco 2811

IOS version - flash:c2800nm-adventerprisek9-mz.124-20.T.bin

Regards,

Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

Ribin

Okay it should look something like this -

ip sla 1

icmp-echo

timeout    <-- you don't necessarily need this unless the link is quite slow

frequency 10 <-- this is in seconds and you can change it to what you want ie. how often the ping happens

ip sla schedule 1 life forever start-time now

track 10 rtr 1 reachability

ip route 0.0.0.0 0.0.0.0

ip route 0.0.0.0 0.0.0.0 250  <- note the 250, this is important

what the above does is ping your primary next-hop address and if it responds then it keeps using the primary default-route. If it stops responding then it removes the primary route and inserts the secondary route. If the ping starts working again it reverses that and installs the primary route again.

Give it a go and let me know how you get on.

Jon

New Member

Re: rsh setup? or any other method for automating?

What does this line say?

"track 10 rtr 1 reachability"

I see below options:

Router(config)#track 10 ?
  application  Application
  interface    Select an interface to track
  ip           IP protocol
  list         Group objects in a list
  stub-object  Stub tracking object

- Ribin

New Member

Re: rsh setup? or any other method for automating?

Also, does this work only if ping to a defined destination stops? or can we set it like it the ping response goes over a certain value then change the route?

- Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

ribin.jones wrote:

What does this line say?

"track 10 rtr 1 reachability"

I see below options:

Router(config)#track 10 ?
  application  Application
  interface    Select an interface to track
  ip           IP protocol
  list         Group objects in a list
  stub-object  Stub tracking object

- Ribin

Ribin

Apologies, i made a mistake in config -

ip route 0.0.0.0 0.0.0.0

should be -

ip route 0.0.0.0 0.0.0.0 track 10 <-- without the track 10 the route isn't tied to IP SLA.

I'm not sure why you don't have the option "rtr". Did all the "ip sla" config go in okay ?

I was assuming it was all supported with advanced IP services feature set. I will check.

Other thing is they do keep changing syntax for IP SLA so i'll check that as well.

Jon

New Member

Re: rsh setup? or any other method for automating?

Thanks and Yes, all other commands worked well.

- Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

Ribin

As expected syntax has changed, actually with 12.4(20)T, use this instead -

track 10 ip sla 1 reachability

as for switching over if over a certain time, i'm not sure. I have never done this as it can lead to link flapping ie. one ping takes a little longer and then the router switches routes and then the next ping works fine and it switches back.

I suspect you may be able to, if i get time i'll have a look, as there are options like threshold that you can configure under the ip sla bit.

Probably worth testing this first though.

Jon

New Member

Re: rsh setup? or any other method for automating?

Great...The secondary ISP route took effect when ping to a defined IP stopped. But when the ping to a defined IP is back, the router doesn't take the primary route. Traffic still goes via the secondary ISP route.

- Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

Ribin

Did you definitely add the 250 to the end of the secondary route ?

Jon

New Member

Re: rsh setup? or any other method for automating?

Seems I did some mistake.

In "icmp-echo "

I gave a known public IP of one of our machine in another location in the place of , which was the one I mentioned as "defined IP" in my preious post. When this machine was shutdown, my router took the second route. May be I need to try with the ISP's next hope in the router?

- Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

ribin.jones wrote:

Seems I did some mistake.

In "icmp-echo "

I gave a known public IP of one of our machine in another location in the place of , which was the one I mentioned as "defined IP" in my preious post. When this machine was shutdown, my router took the second route. May be I need to try with the ISP's next hope in the router?

- Ribin


Ribin

If you can try with the ISP next-hop as the address to ping and make sure secondary route has the 250 at the end. If that still doesn't work we can look at what IP SLA thinks is going on.

Jon

New Member

Re: rsh setup? or any other method for automating?

Thanks Jon...may be I won't be able to try this today. Will get back once I try this.

- Ribin

Hall of Fame Super Blue

Re: rsh setup? or any other method for automating?

No problem. When you do test it, after you setup the initial config, after you drop the line to the ISP and after the line to ISP is brought back up again can you run "sh ip sla monitor statistics" as this will show what IP SLA is doing.

Jon

467
Views
0
Helpful
14
Replies
CreatePlease to create content