cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1264
Views
20
Helpful
6
Replies

OSPF configuration shortcut

jyuffa
Level 1
Level 1

I've been told by one sneaky CCIE that instead of configuring each network of the router to run OSPF there is one command "network x.x.x.x 255.255.255.255 area 0" to activate it on all interfaces. What should I enter instead of x.x.x.x?

Thanks.

6 Replies 6

konigl
Level 7
Level 7

If you set x.x.x.x to 0.0.0.0 ("all zeros") then the inverse mask 255.255.255.255 will match any IP address you assign to an interface. This will activate OSPF for that interface, and put it in area 0.

I've always use network 0.0.0.0 0.0.0.0 area x, and it works.... This also works with eigrp, just in case you're interested.

:-)

Russ.W

Thanks, Russ.

If you have time please take a look on OSPF config below. Any ideas why is it so?? I marked my questions with *************(somewhere toward the middle of the config file)

------------------------------------

Upper#sh run

Building configuration...

Current configuration : 911 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

service udp-small-servers

service tcp-small-servers

!

hostname Upper

!

logging queue-limit 100

enable password cisco

!

ip subnet-zero

!

interface Ethernet0

ip address 10.10.2.2 255.255.255.0

no ip route-cache

no ip mroute-cache

!

interface Serial0

bandwidth 64000

ip address 10.10.10.2 255.255.255.0

no ip route-cache

no ip mroute-cache

!

interface Serial1

no ip address

no ip route-cache

no ip mroute-cache

shutdown

!

router ospf 1

log-adjacency-changes

network 10.10.1.0 0.0.0.255 area 0

network 10.10.10.0 0.0.0.255 area 0

!

router rip

network 10.0.0.0

!

ip classless

no ip http server

!

line con 0

line aux 0

transport input all

line vty 0 4

password cisco

login

!

end

Upper#sh ip ospf int

Serial0 is up, line protocol is up

Internet Address 10.10.10.2/24, Area 0

Process ID 1, Router ID 10.10.10.2, Network Type POINT_TO_POINT, Cost: 1

Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:02

Index 1/1, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 0 msec

Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 10.10.10.1

Suppress hello for 0 neighbor(s)

!

Upper#sh ip ospf database

OSPF Router with ID (10.10.10.2) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count

10.10.10.1 10.10.10.1 133 0x80000002 0x00A7AF 3

10.10.10.2 10.10.10.2 135 0x80000007 0x00BEC0 2

!

Upper#sh ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface

10.10.10.1 1 FULL/ - 00:00:35 10.10.10.1 Serial0

Upper#sh ip route ospf

10.0.0.0/24 is subnetted, 2 subnets

O 10.10.1.0 [110/11] via 10.10.10.1, 00:02:40, Serial0

!

Upper#sh ip ospf

Routing Process "ospf 1" with ID 10.10.10.2

Supports only single TOS(TOS0) routes

Supports opaque LSA

SPF schedule delay 5 secs, Hold time between two SPFs 10 secs

Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs

Number of external LSA 0. Checksum Sum 0x000000

Number of opaque AS LSA 0. Checksum Sum 0x000000

Number of DCbitless external and opaque AS LSA 0

Number of DoNotAge external and opaque AS LSA 0

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

External flood list length 0

Area BACKBONE(0)

Number of interfaces in this area is 1

Area has no authentication

SPF algorithm executed 7 times

Area ranges are

Number of LSA 2. Checksum Sum 0x01666F

Number of opaque link LSA 0. Checksum Sum 0x000000

Number of DCbitless LSA 0

Number of indication LSA 0

Number of DoNotAge LSA 0

Flood list length 0

Upper#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

10.0.0.0/24 is subnetted, 2 subnets

O 10.10.1.0 [110/11] via 10.10.10.1, 00:03:08, Serial0

C 10.10.10.0 is directly connected, Serial0

!

Upper#10.10.10.1

Trying 10.10.10.1 ... Open

In vino veritas

User Access Verification

Password:

Lower>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

---------------------------------

10.0.0.0/24 is subnetted, 2 subnets

C 10.10.1.0 is directly connected, Ethernet0

C 10.10.10.0 is directly connected, Serial0

************ why I don’t see OSPF route here????

----------------------------

Lower>sh ip ospf database

OSPF Router with ID (10.10.10.1) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count

10.10.10.1 10.10.10.1 318 0x80000002 0x00A7AF 3

10.10.10.2 10.10.10.2 321 0x80000007 0x00BEC0 2

Lower>enable

Password:

Lower#sh run

Building configuration...

Current configuration : 1006 bytes

!

version 12.2

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

service udp-small-servers

service tcp-small-servers

!

hostname Lower

!

logging queue-limit 100

enable password cisco

!

ip subnet-zero

!

interface Ethernet0

ip address 10.10.1.1 255.255.255.0

no ip route-cache

no ip mroute-cache

no keepalive

!

interface Serial0

bandwidth 64000

ip address 10.10.10.1 255.255.255.0

no ip route-cache

no ip mroute-cache

no fair-queue

clockrate 64000

!

interface Serial1

no ip address

no ip route-cache

no ip mroute-cache

shutdown

!

interface BRI0

no ip address

encapsulation hdlc

no ip route-cache

no ip mroute-cache

shutdown

!

router eigrp 1

network 10.0.0.0

auto-summary

!

router ospf 1

log-adjacency-changes

network 0.0.0.0 255.255.255.255 area 0

!

router rip

network 10.0.0.0

!

ip classless

no ip http server

!

!

banner motd ^C In vino veritas ^C

!

line con 0

line aux 0

transport input all

line vty 0 4

password cisco

login

!

end

Lower#sh ip ospf int

Serial0 is up, line protocol is up

Internet Address 10.10.10.1/24, Area 0

Process ID 1, Router ID 10.10.10.1, Network Type POINT_TO_POINT, Cost: 1

Transmit Delay is 1 sec, State POINT_TO_POINT,

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:01

Index 2/2, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 0 msec

Neighbor Count is 1, Adjacent neighbor count is 1

Adjacent with neighbor 10.10.10.2

Suppress hello for 0 neighbor(s)

Ethernet0 is up, line protocol is up

Internet Address 10.10.1.1/24, Area 0

Process ID 1, Router ID 10.10.10.1, Network Type BROADCAST, Cost: 10

Transmit Delay is 1 sec, State DR, Priority 1

Designated Router (ID) 10.10.10.1, Interface address 10.10.1.1

No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:01

Index 1/1, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 0, maximum is 0

Last flood scan time is 0 msec, maximum is 0 msec

Neighbor Count is 0, Adjacent neighbor count is 0

Suppress hello for 0 neighbor(s)

Lower#sh ip ospf

Routing Process "ospf 1" with ID 10.10.10.1

Supports only single TOS(TOS0) routes

Supports opaque LSA

SPF schedule delay 5 secs, Hold time between two SPFs 10 secs

Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs

Number of external LSA 0. Checksum Sum 0x000000

Number of opaque AS LSA 0. Checksum Sum 0x000000

Number of DCbitless external and opaque AS LSA 0

Number of DoNotAge external and opaque AS LSA 0

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

External flood list length 0

Area BACKBONE(0)

Number of interfaces in this area is 2 why is it 2 interfaces here???

Area has no authentication

SPF algorithm executed 2 times

Area ranges are

Number of LSA 2. Checksum Sum 0x01666F

Number of opaque link LSA 0. Checksum Sum 0x000000

Number of DCbitless LSA 0

Number of indication LSA 0

Number of DoNotAge LSA 0

Flood list length 0

Lower#

Joseph,

Your Ethernet and serial interfaces are directly connected to those IP subnets, so they are listed as "C" for connected. They are the most direct paths for your router to those networks.

When you run "router ospf x" and specify networks under that, you are enabling your router interfaces on those networks to send and receive OSPF route information and updates over those interfaces. If your router were to hear of a network that it's not directly connected to from another router (for example, your 10.10.10.2 router), then the route would show up as an "O" in the route table.

If your router hears via OSPF about a route to one of the networks it is directly connected to, the directly-connected one is what will show in the route table since it's the lowest-cost path. You would see the OSPF route only if it was equal in cost (in which case you would see each equal-cost path in the routing table) or lower in cost (in which case you would see just the OSPF route). But an OSPF-learned route will never be equal to or lower in cost than a direct connection.

Hope this helps.

Larry,

I understand your logic. But you perhapse overlooked the fact, that in one of the routers ('Upper') "sh ip route" command shows OSPF route. Do you know why? Routers config are the same (except of course IP addresses)

Joseph

Sorry, I just did a search down the listing to where the *****'s were.

Your "Upper" router sits on an Ethernet with 10.10.2.0 subnet, and serial with 10.10.10.0 subnet. OSPF is enabled for "Upper"'s interfaces on the 10.10.10.0 subnet, so it learns about the indirectly connected network 10.10.1.0 from the "Lower" router.

But OSPF is NOT enabled for "Upper"'s interface on the 10.10.2.0 subnet, so it doesn't advertise that subnet to "Lower" over the serial link. Also, it appears that "Upper"'s Ethernet connection on the 10.10.2.0 subnet may be down, since the route didn't show up as a direct-connected network when you executed "show ip route".

Change the "network 10.10.1.0 0.0.0.255 area 0" on "Upper" to "network 10.10.2.0 0.0.0.255 area 0" and make sure the Ethernet port is connected and up, and "Upper" will start advertising the route over the serial connection. "Lower" should learn it pretty quickly when you make the change.

OSPF must be enabled for the subnet that an interface is on, in order for that interface to send and receive OSPF updates. In addition to learning and advertising routes on that port, information about that direct-connected route (and all indirect routes learned through it) will also be advertised out all other OSPF-enabled ports on the router. But only when that link is up. If it starts out down, then the routes don't get advertised; and if it was up but subsequently went down, then link state change advertisements go out all other OSPF-enabled ports, notifying other routers of the change.

I think this is the information you're looking for.