10-03-2019 10:51 AM
Hi there,
I am having a problem to understand the exact role of the network command under the OSPF process, I am talking about OSPF V.2 here.
I understand that network statement is NOT used to advertise networks but it is used to enable OSPF on an interface.
So for example if I have the attached setup.
And on router B I want to advertise network 10.3.5.2/16 to router A and I made the following command on Router B under the ospf process.
RouterB(config)# network 10.3.5.2 0.0.255.255 Area 0
In this case, will router A see also the network 10.4.5.2/16 since it is directly connected on Router B?
And in case Router A will not see network 10.4.5.2/16 and I need this network to be reachable to router A, then should I configure the network command on Router B for the network 10.4.5.2/16 ? But at the same time I don't want Router B & Router C to become neighbors or adjacent.
Will appreciate your help please, thank you.
Solved! Go to Solution.
10-04-2019 01:16 PM
There are several aspects of the original post that need some clarification. The post mentions network statements on router B but has nothing about network statements on router A or C.
The post says that router B wants to advertise 10.3.5.2 to router A. But that network connects router B and A. Since it is a connected network router A will already know about the network and the advertisement from router B is superfluous. Also the post does not specify whether router A has a network statement that includes network 10.3.0.0. If router A does have a network statement including that network then A and B will become OSPF neighbors. If router A does not have such a network statement then the routers will not become neighbors and A will not learn anything from B.
The post then talks about network 10.4.5.2, which connects B and C. If there is no network statement on B for that network then B will not advertise it to A and A will not know about that network (unless there might be a static route on A for that network).
The post then states that they do not want B and C to be neighbors or adjacent. But there is no indication of whether C has a network statement for 10.4.0.0. If C has no network statement for the network then certainly the routers will not become neighbors or adjacent. If C does have a network statement for the network then making the interface passive in OSPF on B will prevent the routers from becoming neighbors or adjacent.
HTH
Rick
10-03-2019 11:06 AM
In routing protocols, the network command indicates to the protocol the interfaces (networks) that participate and are shared.
Therefore, if you want Router A to learn Router B networks, you must first enable, on router A, the interface (netrwork) that connects to Router B.
Router A
network 10.1.5.0 0.0.255.255 area 0
network 10.3.5.0 0.0.255.255 area 0
Router B
network 10.3.5.0 0.0.255.255 area 0
network 10.4.5.0 0.0.255.255 area 0
With these commands, router A will know its connected networks and the 10.4.5.0/16 network connected to router B. In addition, router B will know its connected networks and the 10.1.5.0/16 network connected to router A
If you do not enable any interface (network) on router C, it will not achieve adjacency and will only know directly connected networks.
Regards
10-03-2019 12:43 PM - edited 10-03-2019 12:44 PM
Hello
The network statement is used to identify connected host within the subnet it resides in - infact its best practice to use the most specific network statement you can.
example:
int x/x
ip address 1.1.1.1 255.255.255.0
exit
router ospf 1
network 1.1.1.1. 0.0.0.0 area x instead network 1.1.1.0 0.0.0.255 area 0
Lastly newer software allows you to enable ospf direct on the interface so you dont even have to use the network command. and in ospf3 you have to enable ospf on the interface.
int x/x
ip ospf 1 area x
ospfv3 1 ipv6 area x
10-03-2019 01:46 PM
10-04-2019 09:03 AM
10-04-2019 01:16 PM
There are several aspects of the original post that need some clarification. The post mentions network statements on router B but has nothing about network statements on router A or C.
The post says that router B wants to advertise 10.3.5.2 to router A. But that network connects router B and A. Since it is a connected network router A will already know about the network and the advertisement from router B is superfluous. Also the post does not specify whether router A has a network statement that includes network 10.3.0.0. If router A does have a network statement including that network then A and B will become OSPF neighbors. If router A does not have such a network statement then the routers will not become neighbors and A will not learn anything from B.
The post then talks about network 10.4.5.2, which connects B and C. If there is no network statement on B for that network then B will not advertise it to A and A will not know about that network (unless there might be a static route on A for that network).
The post then states that they do not want B and C to be neighbors or adjacent. But there is no indication of whether C has a network statement for 10.4.0.0. If C has no network statement for the network then certainly the routers will not become neighbors or adjacent. If C does have a network statement for the network then making the interface passive in OSPF on B will prevent the routers from becoming neighbors or adjacent.
HTH
Rick
10-05-2019 01:05 AM
Hi,
As everyone is mentioned that "Network" command is enabling OSPF on the particular interface and start sending and listing the OSPF Multicast (224.0.0.5) packet. If neighbor router will also sending and receiving this same Multicast packet then both routers will start the process to a neighbor (here many other requirements must match, I am not including here).
As you mentioned that
And on router B I want to advertise network 10.3.5.2/16 to router A and I made the following command on Router B under the ospf process.
RouterB(config)# network 10.3.5.2 0.0.255.255 Area 0
Then Router B will start listing and sending OSPF Hello packets on the interface S/0 but if you didn't configure the same command on the Router A then nothing will happen. If this command has configured on Router A as well then it will start the process for Neighborship and adjacency.
In this case, will router A see also the network 10.4.5.2/16 since it is directly connected on Router B?
Ans: By default not. Router A will not see (learn route) the 10.4.5.2/16 because you didn't advertise or added in the OSPF to the particular interface or subnet. If Router A and B are the finished adjacency (means shared OSPF routing table) and you added 10.4.5.2/16 subnet also in the OSPF routing table as with "Network" or "Redistribution" statement then it will only learned by router A.
Basic fundamentals of Dynamic routing table as If you added any subnet or interface in the Routing table of particular routing table as OSPF then it will only share with the it's neighbor/adjacent router.
10-11-2019 08:59 AM
Thank you all, it is much clearer now
10-11-2019 01:05 PM
You are welcome. Thank you for marking this question as solved. This will help other participants in the community to identify discussions which have helpful information.
HTH
Rick
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide