cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1242
Views
0
Helpful
17
Replies

OSPF default routing

rjackson
Level 5
Level 5

My books say that to make ospf advertise a default route create a static default with 'ip route 0.0.0.0 0.0.0.0 x.x.x.x' or use the 'ip default-network x.x.x.0' statement. Then use 'default-info originate always' in the routing process. Always is required for the default-net statement. Since I'm working on a lab I cannot use the static route and I cant get then other method to work right.

Using the default-net statement the router properly advertises the default net to other routers but it does not create a route for itself to use. I put in 'ip default-net 2.2.2.0 and it generates a route statement like this 'ip route 2.0.0.0 255.0.0.0 2.2.2.0'. Anyone know whats going on here?

interface Serial0

ip address 2.2.2.1 255.255.255.252

no ip mroute-cache

clockrate 64000

!

interface Serial1

ip address 1.1.1.2 255.255.255.252

clockrate 64000

!

interface TokenRing0

ip address 20.1.1.1 255.255.255.0

ring-speed 16

!

router ospf 10

network 1.1.1.0 0.0.0.3 area 0

network 20.0.0.0 0.0.0.255 area 0

default-information originate always

!

ip http server

ip classless

ip route 2.0.0.0 255.0.0.0 2.2.2.0

17 Replies 17

rwiesmann
Level 4
Level 4

Hi

Why can you not use a static route? You mentioned that because you have a lab yo ucan not use static routes.

Roger

It is typical in a lab scenrio that it starts with a statement that says you cannot use static routes. I'm trying to understand how I would inject and distribute a default route if I was given those instructions.

hi again

now i know what you mean...there ist one other way i can think of and thats with redistribution from an other dynamic routing protocol. But else the usual

way to do that ist with the static route. But i will check again on that tomorrow.

Roger

ruwhite
Level 7
Level 7

You don't need the default network statement to make ospf create a default route, just the default information originate command. I'm not certain where this concept of using the default network command in conjunction with the default information originate command comes from--the default information originate command can be used with a route map to get ospf to originate a default on the existance of any route in the table.

I HIGHLY discourage the use of the default network command, unless you are running IGRP. And if you're running IGRP, I'd HIGHLY recommend moving to EIGRP. So, essentially, I don't suggest using the default network command for ANYTHING at all.

Russ

The question is how do you define a default route in that router? The default route originate makes it advertise a default, even if it doesn't have one if always is specified. The static route statement "ip route 0.0.0.0 0.0.0.0 x.x.x.x" will give it a default route to use (and propogate if the default-info orig is specified). But every lab scenario I look at starts with a statement 'no static routes are allowed'. If I run into this with OSPF is it possible?

Remember, I'm not concerned about learning or propogating the default route but creating it. Think of it as an edge router to the internet. Its not running BGP and needs a default route pointing into the Internet that it will also propogate into the interior network. Can it be done without a static route?

All, I would like to start this up again, as I have hit the same problem in preparing for the lab and we are strongly encouraged to use the forum as a pool of resource.

It from from karl Solie's book.

Guys,

This is one of those moments where I am about to throw the CCIE Pratical

Studies book out of my window and go down the PUB!

In the book, one of the tasks is to inject a default network into the OSPF

domain without using statics.

So, I do as the book tells me and on my router I add a the following

!

router ospf 2002

router-id 192.168.200.200

log-adjacency-changes

area 10 authentication

area 10 stub no-summary

network 128.10.1.0 0.0.0.255 area 0

network 172.16.1.0 0.0.0.255 area 0

network 172.16.2.4 0.0.0.3 area 10

neighbor 172.16.1.6

neighbor 172.16.1.1

default-information originate always <----ADDED

!

ip classless

ip default-network 128.10.0.0 <----ADDED

Please note there are no static routes on thsi router as instructed.

The "default-information originate always" command injects a default route

into every router into the OSPF domain excpet this router ccie-rtr7 with the

command on. But this has a default network of 128.10.0.0 (refer to page 810

for the diag)

I do a show ip route on this router and it has a candidate default of

128.10.0.0 but no GOLR

I do exactly as the book says, but as this does not set a GOLR on ccie-rtr7,

anything for networks not in the routing table will just get dropped.

Example of debug ip packet at end.

Please help :((

ccie-rtr7#sh 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

172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

O IA 172.16.10.0/28 [110/74] via 172.16.1.1, 00:19:06, Serial0/0.1

[110/74] via 172.16.1.6, 00:19:06, Serial0/0.1

C 172.16.2.4/30 is directly connected, Serial0/0.2

C 172.16.1.0/24 is directly connected, Serial0/0.1

O 172.16.3.0/24 [110/65] via 172.16.2.6, 00:21:06, Serial0/0.2

* 128.10.0.0/24 is subnetted, 1 subnets

C 128.10.1.0 is directly connected, Ethernet0/1

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Ethernet0/0

O E2 11.0.0.0/8 [110/20] via 172.16.1.1, 00:19:06, Serial0/0.1

[110/20] via 172.16.1.6, 00:19:06, Serial0/0.1

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, BRI0/0

ccie-rtr7#

ccie-rtr7#ping 155.195.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 155.195.1.1, timeout is 2 seconds:

01:09:37: IP: s=10.1.1.7 (local), d=155.195.1.1, len 100, unroutable

01:09:39: IP: s=10.1.1.7 (local), d=155.195.1.1, len 100, unroutable.

01:09:41: IP: s=10.1.1.7 (local), d=155.195.1.1, len 100, unroutable.

01:09:43: IP: s=10.1.1.7 (local), d=155.195.1.1, len 100, unroutable

01:09:45: IP: s=10.1.1.7 (local), d=155.195.1.1, len 100, unroutable.

Success rate is 0 percent (0/5)

ccie-rtr7#

I beleive the area 10 stub no-summary command is hosing you , remove it or make it a nssa 'area 10 nssa no-summary'

Quite a coincidence. I was chasing this issue aga last night and the only thing I could find on the subject was my own question I asked months ago.

My routers running 12.2(1) act totally different than yours.

First off, I cannot get it to ever mark a route as a candidate using the default-network command. When I put the command in it changes it to a route statement like this

r7(config)#ip default-network 150.20.78.0

r7#sh run | b router

router ospf 10

log-adjacency-changes

area 0 authentication message-digest

area 30 virtual-link 150.10.6.6 message-digest-key 1 md5 ipexpert

area 30 virtual-link 150.10.5.5 message-digest-key 1 md5 ipexpert

network 150.10.7.7 0.0.0.0 area 30

network 150.20.2.0 0.0.0.63 area 30

network 150.20.78.0 0.0.0.255 area 10

default-information originate always

!

ip route xxx.xxx.xx.0 255.255.0.0 150.20.78.0

I dont know where it gets the 150.20.0.0 value. Before I add that the default-info orig command feeds default routes to every attached router. After I add it it nothing changes. It still feeds a default even to the router on the default net.

And it never gets a default of its own. All these commands just make it the default for the other routers.

I started with one question, "can you give a router a default route without using a static route". I looked at the default-net statement. That may not qualify since it generates a static route. But what else is there and it doesn't work anyway.

Maybe we'll get some help this time.

The default network command won't help you distribute a default route in OSPF--it's designed for IGRP, and works in EIGRP, but other than that, it only immpacts the local routing table.

You might be able to get a local default using the default network to a network which you are learning from some other place (it has to be a classful boundary network, such as a natural class c, for the default network command not to automagically build a static route in your config), then use default information originate always to build the default to other routers in the network. Of course, if this is the trick they are playing, then it won't last much longer, because the default network command will be going away in some future release! :-)

Let me know if this works, and maybe I can think of some other way of doing it. I should get the OSPF guys to sneak in a command to do this, just to fuddle the CCIE lab guys....

Russ.W

Hey Russ, Good to hear from you.

Thats exactly what I did.

I created a classful network (loopback) on the internet router (the one in the lab) and got OSPF to advertise this network to my router (dental-ho or in my lab ccie-rtr7), thus getting a GOLR with the IP default-network command.

The LAB in the CCIE pratical studies book tells you to use a default network of 128.10.0.0 but the lab diagram and how they want you to set it up, you cannot use the default-network of 128.10.0.0 as the ethernet interface they want you to setup is on the 128.10.1.0 /24 network.

THIS WILL FLAG the network as a candidate but not give you a GOLR as follows :-

ccie-rtr7#sh ip route

Gateway of last resort is not set

172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

O IA 172.16.10.0/28 [110/74] via 172.16.1.1, 00:19:06, Serial0/0.1

[110/74] via 172.16.1.6, 00:19:06, Serial0/0.1

C 172.16.2.4/30 is directly connected, Serial0/0.2

C 172.16.1.0/24 is directly connected, Serial0/0.1

O 172.16.3.0/24 [110/65] via 172.16.2.6, 00:21:06, Serial0/0.2

* 128.10.0.0/24 is subnetted, 1 subnets

C 128.10.1.0 is directly connected, Ethernet0/1

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Ethernet0/0

O E2 11.0.0.0/8 [110/20] via 172.16.1.1, 00:19:06, Serial0/0.1

[110/20] via 172.16.1.6, 00:19:06, Serial0/0.1

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, BRI0/0

ccie-rtr7#

This means that if there is a subnet under the classfull network, the GOLR will NOT be set.

So I created loopback 128.11.1.1 255.255.0.0 on the internet router (ccie-rtr4) and used this as a default-network on my ccie-rtr7 router and hey presto - it works :-

ccie-rtr4

interface Loopback666

ip address 128.11.1.1 255.255.0.0

ip ospf network point-to-point

!

router ospf 2002

network 128.11.0.0 0.0.255.255 area 0

ccie-rtr7

ccie-rtr7# sh 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 128.10.1.9 to network 128.11.0.0

172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

O IA 172.16.10.0/28 [110/74] via 172.16.1.1, 00:04:53, Serial0/0.1

[110/74] via 172.16.1.6, 00:04:53, Serial0/0.1

C 172.16.2.4/30 is directly connected, Serial0/0.2

C 172.16.1.0/24 is directly connected, Serial0/0.1

O 172.16.3.0/24 [110/65] via 172.16.2.6, 00:04:53, Serial0/0.2

128.10.0.0/16 is variably subnetted, 3 subnets, 3 masks

O 128.10.2.1/32 [110/11] via 128.10.1.9, 00:04:53, Ethernet0/1

O 128.10.0.0/16 is a summary, 00:04:53, Null0

C 128.10.1.0/24 is directly connected, Ethernet0/1

O* 128.11.0.0/16 [110/11] via 128.10.1.9, 00:04:53, Ethernet0/1

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Ethernet0/0

12.0.0.0/24 is subnetted, 1 subnets

C 12.1.1.0 is directly connected, BRI0/0

O 192.168.33.0/24 [110/11] via 128.10.1.9, 00:04:53, Ethernet0/1

You know what, it's not exactly whats in the book and I dont think it is acheivable becuase the directly connected ethernet with the /24 prevents the GOLR insertion, but we can wast a lot of time doing stuff like this, and yeah, we learn from it, but when you are on a tight schedule, it really is not much help.

Karl Solie owes me a beer I think, so mention that to him if you see him please !!

Kind regards,

Ken

Here is a test to show that the network can have any subnets either connected or otherwise, otherwise the

GOLR WILL NOT BE SET.

remote_router2 (internet rtr)

interface Loopback1

ip address 172.16.1.1 255.255.255.0

!

interface Loopback2

ip address 172.16.21.1 255.255.255.0

!

interface Loopback900

ip address 172.17.1.1 255.255.0.0

ip ospf network point-to-point

!

interface Loopback901

ip address 172.18.1.1 255.255.255.0

!

interface Loopback902

ip address 172.18.2.1 255.255.255.0

!

interface FastEthernet0/0

ip address 192.168.1.2 255.255.255.0

duplex auto

speed auto

!

!

interface FastEthernet0/1

ip address 172.16.10.1 255.255.255.0

duplex auto

speed auto

!

router ospf 1

log-adjacency-changes

network 172.16.0.0 0.0.255.255 area 0

network 172.17.0.0 0.0.255.255 area 0

network 172.18.0.0 0.0.255.255 area 0

!

remote_router config

!

router ospf 1

network 172.16.0.0 0.0.255.255 area 0

!

ip classless

ip default-network 172.16.0.0

set command IP DEFAULT-NETWORK 172.18.0.0 - No GOLR Set

remote_router#sh 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

21.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 21.1.1.0/24 is directly connected, Loopback1

C 21.21.21.0/30 is directly connected, FastEthernet0/1

C 21.1.2.0/24 is directly connected, Loopback2

O 172.17.0.0/16 [110/2] via 172.16.10.1, 00:00:49, FastEthernet0/0

172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

C 172.16.128.0/30 is directly connected, Async65

O 172.16.21.1/32 [110/2] via 172.16.10.1, 00:00:49, FastEthernet0/0

C 172.16.10.0/24 is directly connected, FastEthernet0/0

O 172.16.1.1/32 [110/2] via 172.16.10.1, 00:00:49, FastEthernet0/0

* 172.18.0.0/32 is subnetted, 2 subnets

O 172.18.2.1 [110/2] via 172.16.10.1, 00:00:49, FastEthernet0/0

O 172.18.1.1 [110/2] via 172.16.10.1, 00:00:49, FastEthernet0/0

12.0.0.0/24 is subnetted, 4 subnets

C 12.200.200.0 is directly connected, Loopback206

C 12.6.6.0 is directly connected, Loopback202

C 12.5.5.0 is directly connected, Loopback201

C 12.1.1.0 is directly connected, BRI1/0

remote_router#

set command IP DEFAULT-NETWORK 172.17.0.0 - GOLR SET

ternal 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 172.16.10.1 to network 172.17.0.0

21.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 21.1.1.0/24 is directly connected, Loopback1

C 21.21.21.0/30 is directly connected, FastEthernet0/1

C 21.1.2.0/24 is directly connected, Loopback2

O* 172.17.0.0/16 [110/2] via 172.16.10.1, 00:02:36, FastEthernet0/0

172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

C 172.16.128.0/30 is directly connected, Async65

O 172.16.21.1/32 [110/2] via 172.16.10.1, 00:02:36, FastEthernet0/0

C 172.16.10.0/24 is directly connected, FastEthernet0/0

O 172.16.1.1/32 [110/2] via 172.16.10.1, 00:02:37, FastEthernet0/0

172.18.0.0/32 is subnetted, 2 subnets

O 172.18.2.1 [110/2] via 172.16.10.1, 00:02:37, FastEthernet0/0

O 172.18.1.1 [110/2] via 172.16.10.1, 00:02:37, FastEthernet0/0

12.0.0.0/24 is subnetted, 4 subnets

C 12.200.200.0 is directly connected, Loopback206

C 12.6.6.0 is directly connected, Loopback202

C 12.5.5.0 is directly connected, Loopback201

C 12.1.1.0 is directly connected, BRI1/0

remote_router#

set command IP DEFAULT-NETWORK 172.16.0.0 - No GOLR Set

remote_router#sh 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

21.0.0.0/8 is variably subnetted, 3 subnets, 2 masks

C 21.1.1.0/24 is directly connected, Loopback1

C 21.21.21.0/30 is directly connected, FastEthernet0/1

C 21.1.2.0/24 is directly connected, Loopback2

O 172.17.0.0/16 [110/2] via 172.16.10.1, 00:03:14, FastEthernet0/0

* 172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks

C 172.16.128.0/30 is directly connected, Async65

O 172.16.21.1/32 [110/2] via 172.16.10.1, 00:03:14, FastEthernet0/0

C 172.16.10.0/24 is directly connected, FastEthernet0/0

O 172.16.1.1/32 [110/2] via 172.16.10.1, 00:03:14, FastEthernet0/0

172.18.0.0/32 is subnetted, 2 subnets

O 172.18.2.1 [110/2] via 172.16.10.1, 00:03:14, FastEthernet0/0

O 172.18.1.1 [110/2] via 172.16.10.1, 00:03:14, FastEthernet0/0

12.0.0.0/24 is subnetted, 4 subnets

C 12.200.200.0 is directly connected, Loopback206

C 12.6.6.0 is directly connected, Loopback202

C 12.5.5.0 is directly connected, Loopback201

C 12.1.1.0 is directly connected, BRI1/0

remote_router#

This candidate default isn't sent to other routers as a candidate default, is it? It only impacts the local router's routing table. To get a default in the surrounding routers, you need a default information originate, or a 0/0 redistributed into the ospf process. OSPF doesn't know how to mark a "candidate default."

Oh, the _route_ is carried through the network, but you have to configure every router with the default-network command.

:-)

Russ

Hey i think I finally understand it and it is possible, sometimes.

Heres the link:

http://www.cisco.com/en/US/customer/tech/tk365/tk554/technologies_tech_note09186a0080094374.shtml

they hid it under RIP but it talks about the default routing process in general; in great detail.

Here's my summary of it. Regardless of what you read elsewhere the "ip default-network" command is protocol independent; BUT, it is classful. That is why is always changes your command into a route statement if you entered a non-classfull network. Then you are supposed to enter the ip default-network command again for the classfull network that the ios put the route statement in for!!!!!!! Now you will have a GOLR.

Obviously it will only work if its valid to summarize the network over that next hop.

The protocol dependent part of it is entirely based on how the router will propogate the default route.

Check out the link and read it carefully, its great.

Now that I'm over the elation of finally figuring out the ip default-network command I realized that there is still a static route in the solution and the proctor wont care that I didn't type it in. So here's the complete solution from my lab. I dont know all the restictions in the lab you were doing.

!

router ospf 10

log-adjacency-changes

area 10 range 128.100.0.0 255.255.0.0

.

.

network 150.10.7.7 0.0.0.0 area 30

network 150.20.2.0 0.0.0.63 area 30

network 150.20.78.0 0.0.0.255 area 10

!

ip default-network 128.100.0.0

The area range command summarizes the default into the classfull network that the ip default-network command will use to insert a GOLR into the route table.

r7#sh ip ro

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 0.0.0.0 to network 128.100.0.0

B 200.200.200.0/24 [200/0] via 150.10.8.8, 03:48:28

B 172.16.0.0/16 [20/0] via 150.20.2.6, 1d15h

[20/0] via 150.20.2.5, 1d15h

188.5.0.0/24 is subnetted, 1 subnets

O E2 188.5.254.0 [110/20] via 150.20.2.5, 00:08:44, Ethernet0

O E2 193.100.5.0/24 [110/20] via 150.20.2.6, 00:08:44, Ethernet0

[110/20] via 150.20.2.5, 00:08:44, Ethernet0

* 128.100.0.0/16 is variably subnetted, 2 subnets, 2 masks

O* 128.100.0.0/16 is a summary, 00:08:45, Null0

O 128.100.1.0/24 [110/65] via 150.20.78.8, 00:08:45, Serial1

O 192.168.1.0/24 [110/65] via 150.20.78.8, 00:08:45, Serial1

150.50.0.0/24 is subnetted, 2 subnets

.

.

.

...now I'm ready for that trip to the pub you mentioned.....

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: