cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
24997
Views
0
Helpful
8
Replies

changing gateway of last resort

gordfran03
Level 1
Level 1

I'm planning to change my LAN's gateway of last resort to a new IP address. When I type "set ip route 0.0.0.0 0.0.0.0 192.168.1.1" will it replace or overwrite the old value immediately, or does the old value need removed first? Also, are there any caveats I should watch out for when making such a change? Thanks.

8 Replies 8

john kennedy
Level 1
Level 1

What device and IOS version are you using?

It's s 4506 running ipbase 12.2.54.

Then the command is "IP route 0.0.0.0 0.0.0.0 192.168.1.1" you shouldn't have to negate the other route but after you configure the new one do a  "show run | include route " to check if it overwrote the existing route.

to verify your actual gateway, you can also do a "show ip route" and check for the line that begins with "

Gateway of last resort is"

rtjensen4
Level 4
Level 4

It will add it as a redundant route. You'll need to remove the old one. Here's a simple example:

Router>en

Router#config t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#int fa0/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#no shut

Router(config-if)#

Router(config-if)#

Router(config-if)#

Router(config-if)#ip route 0.0.0.0 0.0.0.0 192.168.1.5

Router(config)#do 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 192.168.1.5 to network 0.0.0.0

C    192.168.1.0/24 is directly connected, FastEthernet0/0

S*   0.0.0.0/0 [1/0] via 192.168.1.5

Router(config)#

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.6

Router(config)#

Router(config)#do 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 192.168.1.6 to network 0.0.0.0

C    192.168.1.0/24 is directly connected, FastEthernet0/0

S*   0.0.0.0/0 [1/0] via 192.168.1.6

               [1/0] via 192.168.1.5

Router(config)#

Sakun Sharma
Level 1
Level 1

Hi,

You have to remove your old 'ip route' command, else it will add both the routes in routing table if next hope is reachable and will most probably send all the traffic from the interface having lowest interface number.

Like if two default routes are there from S0/0 and S0/1, mostly it will send all the traffic from S0/0. You can verify that, I am not sure about it, but in my test scenerio it works like that.

Hi,

if the old route is not deleted then both routes will get installed indeed and the device will do per src-dst load-sharing by default as traffic is CEF switched( transit traffic).traffic from or destined to the device will be processed switched so load-shared per-packet.

Regards

Alain

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

The both route will be added in routing table if you not remove the older one and router will do the load sharing on these routes beacuse ecach will have the same AD value.

Review Cisco Networking for a $25 gift card