Difference between default network and gateway of last resort

Hello All,

I'm hoping some clarification can provided to me on the difference between default network and gateway of last resort and when you would use one instead of the other.

Eg. ip route 0.0.0.0 0.0.0.0 x.x.x.x - gateway of last resort. Eg. ip default-network x.x.x.x

Thanks,

Adil

Reply to
AN
Loading thread data ...

This explicitly defines a default route.

This one says to follow the x.x.x.x network as a default. And hope that someone along the line will know how to route. It also requires that one (sub)network in the x.x.x.x be present for it to works.

So if you do "ip default-network 172.16.0.0" and your routing table has

172.16.1.0 /24 via 172.16.1.1

Then it will use 172.16.1.1 as the default next hop

Reply to
Hansang Bae

Hansang is right,

ip route 0.0.0.0 0.0.0.0 x.x.x.x = if there is no better route for that destination, I'll send it to x.x.x.x ip default-network x.x.x.x= anyone in network x.x.x.x, if you don't have better route send it to me.

I also know that ip default-network x.x.x.x applies to network which has RIP as a routing protocol

tayfun

Reply to
Tayfun Tuna

I would just like to add that x.x.x.x in 'ip defaut-network x.x.x.x' has to be major network (classfull one) to work as Hansang did in his example but did not explicitly said that.

Hm.. this post does not make sense to me anymore :-).

Reply to
Ivan Ostreš

Actually, even if you use a non-classful one, the IOS will create a static route to null. It should still work regardless.

Reply to
Hansang Bae

Yes, it will create a static route but not really to null. It still won't set "Gateway of last resort..." as you can see in following example:

r1#sh ip ro [snip]

Gateway of last resort is not set

1.0.0.0/30 is subnetted, 1 subnets C 1.1.1.0 is directly connected, FastEthernet0/0 172.16.0.0/24 is subnetted, 1 subnets S 172.16.12.0 [1/0] via 1.1.1.2 r1# r1# r1# r1#conf t Enter configuration commands, one per line. End with CNTL/Z. r1(config)#ip default-network 172.16.12.0 r1(config)#exit r1# Mar 12 03:25:15.405: %SYS-5-CONFIG_I: Configured from console by console r1#sh ip ro [snip]

Gateway of last resort is not set

1.0.0.0/30 is subnetted, 1 subnets C 1.1.1.0 is directly connected, FastEthernet0/0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks S 172.16.12.0/24 [1/0] via 1.1.1.2 S 172.16.0.0/16 [1/0] via 172.16.12.0 r1# r1# r1#conf t Enter configuration commands, one per line. End with CNTL/Z. r1(config)#ip default-network 172.16.0.0 r1(config)#exit r1#sh Mar 12 03:25:31.305: %SYS-5-CONFIG_I: Configured from console by console r1# r1#sh ip ro [snip]

Gateway of last resort is 172.16.12.0 to network 172.16.0.0

1.0.0.0/30 is subnetted, 1 subnets C 1.1.1.0 is directly connected, FastEthernet0/0 * 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks S 172.16.12.0/24 [1/0] via 1.1.1.2 S* 172.16.0.0/16 [1/0] via 172.16.12.0 r1# r1# r1#sh ver Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-SY7-M), Version 12.3(13), RELEASE SOFTWARE (fc2)
Reply to
Ivan Ostreš

Ivan, What version of IOS did you do this on?

Reply to
Hansang Bae

r1#sh ver Cisco Internetwork Operating System Software IOS (tm) C1700 Software (C1700-SY7-M), Version 12.3(13), RELEASE SOFTWARE (fc2)

So, it's a pretty new mainline...

Reply to
Ivan Ostreš

Cabling-Design.com Forums website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.