Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Does any one knows a way to configure a cisco router with multiple gateways - multiple gateways of last resort?

I've tried adding a gateway of last resort twice (with different metric) but only one is shown:

Router(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.2 10
Router(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.3 100

And the show ip route output was:

Router# show ip route
Gateway of last resort is 2.2.2.2 to network 0.0.0.0

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, FastEthernet0/0
     3.0.0.0/24 is subnetted, 1 subnets
C       3.3.3.0 is directly connected, FastEthernet0/1
     32.0.0.0/30 is subnetted, 1 subnets
C       32.2.2.0 is directly connected, Serial0/2/0
S*   0.0.0.0/0 [10/0] via 2.2.2.2

The point is that i cannot see the other route with higher distance metric?

Anyone has a sugestion?

I mean will this config work if the link on 2.2.2.2 fails? Will the router choose the other network 3.3.3.3, if the link 2.2.2.2 fails?

share|improve this question
1  
Please explain the downvote? –  SpacemanSpiff Nov 25 '11 at 14:36

2 Answers 2

up vote 5 down vote accepted

IIRC, if you put different metrics only the best route will be injected in the main routing table.

So you have three choices:

First choice, as @dkaragasidis said, don't put the metrics (to get per session load-balancig) but then the traffic will flow nearly 50% on both links

Second choice, use some sort of dynamic routing protocol (i suggest BGP) if possbile.

Third choice, use ip sla commands to costantly check for ip availability.

Keep in mind that if one FastEthernet interface (or the remote port with which is connected) fails (i.e. the status of the interface goes to down) then the router automatically injects the other default route, but NOT if the 2.2.2.2 router somehow doesn't work (in that case the ip sla commands will take care of this).

If BGP is not an option and you really don't wanto to balance the gateways, ip sla is your best solution. Take a look at this answer to a similar question for a link to some examples.

share|improve this answer
    
Thank you MrShunz your answer was usefull.. I guess I will try the third one :) –  Spirit Nov 28 '11 at 9:10

Consider checking out Cisco's Configuring a Gateway of Last Resort Using IP Commands.

If you use multiple ip route 0.0.0.0 0.0.0.0 commands to configure a default route, traffic is load-balanced over the multiple routes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.