cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
994
Views
0
Helpful
13
Replies

Doubts about OSPF.

ciscolover
Level 1
Level 1

Hi all, I have some doubts about ospf and I hope you can help me.

For example, if I have 2 routers conected, router A and router B. They are talking ospf area 0

Router A its connected to 3 subnets

192.168.1.0/24

192.168.2.0/24-->This it's a subnet that connect with users.

192.168.3.0/24-->This it's a subnet that connect with users.

router B has one subnet.This its the subnet that connects with router A.

192.168.1.0/24

I want that router A informs router B about the subnets 192.168.2.0 and 192.168.1.0.

¿What do you consider the best form?

1º)Redistribute connected command in the ospf area 0¿?

2º)Network 192.168.2.0 0.0.0.255 area 0

    Network 192.168.3.0 0.0.0.255 area 0

With the 2 options router B will knows this 2 networks but i think its better the redistribute connected command.

I think its better than the second option because with the second option you generate OSPF traffic in this 2 networks and its not necesary.

Please, can you explain me which you consider the best option?

Thanks ¡¡

13 Replies 13

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

The most appropriate way, in my opinion, is to use the second option with the network commands, and subsequently, use the passive-interface command to declare the interfaces with 192.168.2.0/24 and 192.168.3.0/24 as passive interfaces. OSPF will not send nor process received OSPF packets on those interfaces.

Best regards,

Peter

patrick.boyle
Level 1
Level 1

It's important to remember that in OSPF the network statement does NOT determine what networks the protocol advertises. It determines what interfaces on the router run the OSPF process. That being said, I tend to use the 'passive-interface default' command to make all interfaces passive by default, then use a more general network command to encompass all interfaces:

router ospf 1

passive-interface default

network 192.168.0.0 0.0.3.255 area 0

no passive-interface

This way you're running the protocol on all the interfaces, but have complete control over what interfaces send OSPF traffic.

gfcisco31
Level 1
Level 1

passive-interface default

no passive interface <192.168.1.0/24>

network 0.0.0.0 0.0.0.0 area 0

redistribute connected

Thanks all for your answers. I had forgotten the passive interface command ¡¡¡

Patrik, it determines what interfaces on the router run the OSPF process but it says too wich networks the protocol advertises, or not? Could you explain this more?

In RIP i trought the command network was to annonce the RIP networks.

Thanks all for your help ¡¡

In patriks configuration it does the following.

router ospf 1

passive-interface default  -> Basically prevents hellos from being sent out ALL interfaces

no pass s1/0                  -> Allows hellos to flow through s1/0

Patrik, it determines what interfaces on the router run the OSPF  process but it says too wich networks the protocol advertises, or not?  Could you explain this more?

---->> IT indeed determines what interface participating in the routing process.  If you add the command for example >>> network 0.0.0.0 0.0.0.0 area 0 and you have an interface with ip add 192.160.0.1/24, you will form the neigh relationship and also propagate this network as LSA 1 to your DR in the area .  With this general network entry (0.0.0.0) you will add any interfaces that is willing to participate in the ospf process, that is why we use passive interface default, to explicitly tell the router which one will participate.

In RIP i trought the command network was to annonce the RIP networks.

---> Yes, RIP u do not form any neighbor relationship, so the command is used just to advertise the prefix.  Two totally different routing protocols

A god bokk to understand how IGPs work, is the routing tcp/ip by Jeff Doyle.

hope this helps

Hi,

In RIP i trought the command network was to annonce the RIP networks.

--->  Yes, RIP u do not form any neighbor relationship, so the command is  used just to advertise the prefix.  Two totally different routing  protocols

That's incorrect in every IGP the network command tells which interface is participating in the routing protocol, although there is no neighbour in RIP you still have to enable the interface for sending updates and listen for updates

Regards.

Alain

Don't forget to rate helpful posts.

"

although there is no neighbour in RIP you still have to enable the interface for sending updates and listen for updates

"

That is what i said.... you dont form a peer relationship but you send updates, containing what ? prefixes from interfaces ative in the process 

that is what i meant

cheers

Hi,

ok if this is what you meant but you said:  so the command is  used just to advertise the prefix

this is incorrect, this true only for BGP not any IGPs.

Regards.

Alain

Don't forget to rate helpful posts.

Yes, In ALL IGPs the network command is only used to match on the IP address of routed interfaces. Interfaces that are matched will now participate in routing and send updates unless passified.

I think the confusion is because unless an interface is matched by a network statement, the IGP will not advertise it's subnet as a connected network (unless' redistribute connected' is used), so in practice it is similar to specifying what networks to advertise.

BUT, again you only have to match on an interface's IP address. So, for example:

R1 has an f0/0 interface with 192.168.1.1 255.255.255.0

router ospf 1

network 192.168.1.1 255.255.255.255 area 0  <--- this command can be used to match the interface's IP address, and OSPF will advertise the entire 192.168.1.0 /24 subnet.

And when you work with a L3 switch... It's not different?

No, it's the same for switches.

But  in the L3 switches you apply the passive interface for all the L3 interface associated to the Vlan or not? To apply it to a specifical interface you need to put the no switchport.

Thanks.

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:

Review Cisco Networking products for a $25 gift card