cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2580
Views
10
Helpful
10
Replies

Floating static route not working?

Gordon Blueau
Level 1
Level 1

Hello everybody,

So I have this question:

I have two routers connected together with two serial cables (networks 

192.168.1.0/30 and 192.168.2.0/30), where on each router is loopback for 

testing purposes.

This is my initial setting:

Router1:

Gateway of last resort is not set

     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial2/0
     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
     192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.10.0/24 [200/0] via 192.168.2.2
O       192.168.10.1/32 [110/65] via 192.168.1.2, 00:02:24, Serial2/0
C    192.168.20.0/24 is directly connected, Loopback0

Router2:

Gateway of last resort is not set

     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
C    192.168.10.0/24 is directly connected, Loopback0
     192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.20.0/24 [200/0] via 192.168.2.1
O       192.168.20.1/32 [110/65] via 192.168.2.1, 00:00:08, Serial3/0

Router2(config)#

I issue this command on router1:
Router1(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.2 200

and this one on router2:
Router2(config)#ip route 192.168.20.0 255.255.255.0 192.168.2.1 200

after that I wanna test if it behaves correctly, that is. when 192.168.1.0/30 

is up, it should route packets through it and only through it. If it is down, 

it should route packets through 192.168.2.0/30.

Now, when I turn one of the serial ports 192.168.1.0/30 down, ospf will learn 

about loopback on other network correctly through the 192.168.2.0/30:

Router1:

Gateway of last resort is not set

     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
     192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.10.0/24 [200/0] via 192.168.2.2
O       192.168.10.1/32 [110/65] via 192.168.2.2, 00:00:03, Serial3/0
C    192.168.20.0/24 is directly connected, Loopback0

Router2:

Gateway of last resort is not set

     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
C    192.168.10.0/24 is directly connected, Loopback0
     192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.20.0/24 [200/0] via 192.168.2.1
O       192.168.20.1/32 [110/65] via 192.168.2.1, 00:00:08, Serial3/0
Router2(config)#

But when I turn it back up, for some reason, it still uses 192.168.2.0/30 

serial, although that way has administratively set higher Administrative 

distance (less trustful):

Router 1:

Gateway of last resort is not set

     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial2/0
     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
     192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.10.0/24 [200/0] via 192.168.2.2
O       192.168.10.1/32 [110/65] via 192.168.2.2, 00:01:40, Serial3/0
C    192.168.20.0/24 is directly connected, Loopback0
Router(config)#

Router 2:

Gateway of last resort is not set

     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial2/0
     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
C    192.168.10.0/24 is directly connected, Loopback0
     192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
S       192.168.20.0/24 [200/0] via 192.168.2.1
O       192.168.20.1/32 [110/65] via 192.168.2.1, 00:01:46, Serial3/0
Router2(config)#

My question is: what am I doing wrong? 

I want only 192.168.1.0/30 network to be used, and the second one only in the 

case of failure, but when the 192.168.1.0/30 network is up and running, 

second one should not be used at all. Why is it using it even after the 

1.0/30 was restored?

 

EDIT:// For a completeness sake, I should add I am doing this in Packet Tracer (it is not always behaving correctly, as real hardware would, to my knowledge. Yes, i have the newest version of Packet Tracer (6.1.1.0001) ).

1 Accepted Solution

Accepted Solutions

Hello

 

Router 1
 

delete all static routes and remove ospf

no ip route xxxx xxxx etc..
no ip router ospf 10


interface Loopback0
 ip address 192.168.20.1 255.255.255.0


interface Serial2/0
ip address 192.168.1.1 255.255.255.252


interface Serial3/0
 ip address 192.168.2.1 255.255.255.252

 

router ospf 10
network 0.0.0.0 0.0.0.0 area 0 
    ( this will advertise all interfaces in ospf)

 


Router 2
 

delete all static routes and remove ospf

no ip route xxxx xxxx etc..
no ip router ospf 10


interface Loopback0
ip address 192.168.10.1 255.255.255.0


interface Serial2/0
 ip address 192.168.1.2 255.255.255.252


interface Serial3/0
 ip address 192.168.2.2 255.255.255.252


router ospf 10
network 0.0.0.0 0.0.0.0 area 0
     ( this will advertise all interfaces in ospf)


At this point if you do

sh ip route

you should now see two paths on either roruter to the loopback address of the other router

 

Now to make ser2/0 from each router to take precedence.

 

on both routers apply...

interface Serial3/0
ip ospf cost 1000

Now when you do sh ip route there will be only one path towards the loopbacks on either router and this will be via ser2/0.


Lastly if you shutdown ser2/0 then the path will change to go via ser3/0

 

res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

10 Replies 10

Hello

It should work, can you post your config for both routers.

 

The other option without even using static addressing is to enable ospf on both serial interfaces and then you just increase the opsf cost on ser3/0 of each router, this way preffered path will be se2/0 and backup will be ser3/0.

 

res

Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello Paul,

Dang, You´re right - I should have made the 192.168.1.0/30 learned through OSPF, then it should work.

EDIT:// You know, I am trying to make the primary route learned through OSPF and I changed the secondary route Admin. dist to 200 so it would be less trustful, so that it would be used only in case the primary would stop working. 

And for all the tea in China I cannot get it working. 

By config you mean output of show running-config? Here it is: 

 

Router(config)#show running-config
                ^
% Invalid input detected at '^' marker.
 
Router(config)#
Router(config)#do show running-config
Building configuration...
 
Current configuration : 1066 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 192.168.20.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet1/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial2/0
 ip address 192.168.1.1 255.255.255.252
 clock rate 2000000
!
interface Serial3/0
 ip address 192.168.2.1 255.255.255.252
 clock rate 2000000
!
interface FastEthernet4/0
 no ip address
 shutdown
!
interface FastEthernet5/0
 no ip address
 shutdown
!
router ospf 10
 log-adjacency-changes
 network 192.168.20.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.3 area 0
 network 192.168.2.0 0.0.0.3 area 0
!
ip classless
ip route 192.168.10.0 255.255.255.0 192.168.2.2 200
ip route 192.168.10.0 255.255.255.0 192.168.1.2 110
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end
 
 
 
 
Router2(config)#do show running-config
Building configuration...
 
Current configuration : 1067 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router2
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 192.168.10.1 255.255.255.0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface FastEthernet1/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface Serial2/0
 ip address 192.168.1.2 255.255.255.252
 clock rate 2000000
!
interface Serial3/0
 ip address 192.168.2.2 255.255.255.252
 clock rate 2000000
!
interface FastEthernet4/0
 no ip address
 shutdown
!
interface FastEthernet5/0
 no ip address
 shutdown
!
router ospf 10
 log-adjacency-changes
 network 192.168.10.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.3 area 0
 network 192.168.2.0 0.0.0.3 area 0
!
ip classless
ip route 192.168.20.0 255.255.255.0 192.168.2.1 200
ip route 192.168.20.0 255.255.255.0 192.168.1.1 110
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

Hello

 

So try this: both routers{

1) delete the statics
 
2) interface Loopback0
ip ospf network point-to-point
 
3) interface Serial3/0
ip ospf cost 100
 
res
Paul
 

3)
 
 

Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

I am sorry, Paul,

 

Can you write me step by step instructions?

I have tried several combinations, none of them are working, I am at a loss here :(

hello

So try this: both routers{

1) delete all the statics routes
 
2) interface Loopback0

ip ospf network point-to-point

 

3) no router ospf 10
router ospf 10
network 0.0.0.0 0.0.0.0 area 0

 
4) interface Serial3/0
ip ospf cost 100
 
 
res
Paul

Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello

Thanks for the rating - were you able to follow my instructions and if so were you sucessfull

 

Please close post as answered so it my help others in the future

 

res

Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hello Paul,

 

I apologize for later reply.

I was able to follow them, but I haven´t been able to work this out.

I tried to put that solution in the very same way as you describe, then also on a restarted routers - no luck.

 

Thing I don´t understand is why would I need to delete the static routes? I 

mean, if I do that, those routers are not able to communicate with each other, because there are no IP´s on a serial ports.

 

Also, when i enable OSPF (router ospf 10) and add only network 0.0.0.0 0.0.0.0 +  my primary network, it will propagate OSPF only through them and if I disable the primary network, it won´t propagate it through secondary route.

 

But when I add also secondary network to OSPF, again, when I shut down primary route, it will use the secondary, but when I turn it back again, it will still use the secondary, even when OSPF cost was set to 100. :(

Damn, I really have no idea what am I doing wrong.

Hello

 

Router 1
 

delete all static routes and remove ospf

no ip route xxxx xxxx etc..
no ip router ospf 10


interface Loopback0
 ip address 192.168.20.1 255.255.255.0


interface Serial2/0
ip address 192.168.1.1 255.255.255.252


interface Serial3/0
 ip address 192.168.2.1 255.255.255.252

 

router ospf 10
network 0.0.0.0 0.0.0.0 area 0 
    ( this will advertise all interfaces in ospf)

 


Router 2
 

delete all static routes and remove ospf

no ip route xxxx xxxx etc..
no ip router ospf 10


interface Loopback0
ip address 192.168.10.1 255.255.255.0


interface Serial2/0
 ip address 192.168.1.2 255.255.255.252


interface Serial3/0
 ip address 192.168.2.2 255.255.255.252


router ospf 10
network 0.0.0.0 0.0.0.0 area 0
     ( this will advertise all interfaces in ospf)


At this point if you do

sh ip route

you should now see two paths on either roruter to the loopback address of the other router

 

Now to make ser2/0 from each router to take precedence.

 

on both routers apply...

interface Serial3/0
ip ospf cost 1000

Now when you do sh ip route there will be only one path towards the loopbacks on either router and this will be via ser2/0.


Lastly if you shutdown ser2/0 then the path will change to go via ser3/0

 

res
Paul


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

"At this point if you do

sh ip route

you should now see two paths on either roruter to the loopback address of the other router"

No, this is what I see when I did exactly what you described (+ turned on the serial interfaces, otherwise only loopbacks have been seen):

Router1(config)#do show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial2/0
     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
C    192.168.20.0/24 is directly connected, Loopback0
Router1(config)#


Router2(config)#do show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial2/0
     192.168.2.0/30 is subnetted, 1 subnets
C       192.168.2.0 is directly connected, Serial3/0
C    192.168.10.0/24 is directly connected, Loopback0
Router2(config)#

 

So, since the path to other router is not propagated, I tried also this:
I went to each port and applied ip ospf network point-to-point to both loobacks only (still the same output as the one above), then I went to all serial ports on both routers and applied the same - still the same output as the one before.

 

Then I went and retyped on both routers 

router ospf 10
network 0.0.0.0 0.0.0.0 area 0

again, the same result.

Hello Paul,

 

After debating this problem with my classmate, I found out it is enough for us to do one OSPF route (primary) and one static route (secondary), simply because we do not have yet the knowledge to do what I thought we should do (both OSPF, one as a backup).

 

And what we needed to do is not so far away from my former configuration – I was missing point-to-point commands on ports + we actually, to my surprise, had to use admin. distance (which I thought was wrong), instead of cost for the secondary route.

And now I feel really bad because you tried to help me all along and I realized I am asking the wrong question :/

 

I apologize for that.

 

So that I would not feel that bad now, I´m leaving here my working configuration to my actual problem, because it might still help somebody else.

 

hostname Router1

int loop0
ip address 192.168.20.1 255.255.255.0
ip ospf network point-to-point
exit

int s2/0
ip address 192.168.1.1 255.255.255.252
no shut
exit

int s3/0
ip address 192.168.2.1 255.255.255.252
no shut
exit

router ospf 10
network 192.168.1.0 0.0.0.3 area 0
network 192.168.20.0 0.0.0.255 area 0
exit

ip route 192.168.10.0 255.255.255.0 192.168.2.2 200

 

hostname Router2


int loop0
ip address 192.168.10.1 255.255.255.0
ip ospf network point-to-point
exit

int s2/0
ip address 192.168.1.2 255.255.255.252
no shut
exit

int s3/0
ip address 192.168.2.2 255.255.255.252
no shut
exit

router ospf 10
network 192.168.1.0 0.0.0.3 area 0
network 192.168.10.0 0.0.0.255 area 0
exit

ip route 192.168.20.0 255.255.255.0 192.168.2.1 200
exit

 

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: