02-13-2025 08:10 PM
Folks,
I am trying to understand when to use the command "area 0 range 10.0.0.0 0.0.255.255" instead of just the "network 10.0.0.0 0.0.255.255 area 0" with the topology shown below. The full commands are shown below, and I am trying to contrast both. Any help would be great. Thanks. NOTE: This lab was taken from Neil Anderson's CCNA trying via Flackbox.
Actual configuration (right one):
R2(config)#router ospf 1
R2(config-router)#area 0 range 10.1.0.0 255.255.0.0
R2(config-router) #area 1 range 10.0.0.0 255.255.0.0
********************************************************
R5(config)#router ospf 1
R5(config-router)#area 0 range 10.1.0.0 255.255.0.0
R5(config-router)#area 1 range 10.0.0.0 255.255.0.0
*******************************************************
Contrasting configuration (why note this one?):
R2(config)#router ospf 1
R2(config-router)#network 10.0.0.0 0.0.255.255 area 1
R2(config-router)#network 10.1.0.0 0.0.255.255 area 0
***********************************************************
R5(config)#router ospf 1
R5(config-router)#network 10.0.3.0 0.0.255.255 area 1
R5(config-router)#network 10.1.3.0 0.0.255.255 area 0
*********************************************************
Solved! Go to Solution.
02-13-2025 11:32 PM
You need both'
Network xxxx1/2 area x <<- will add xxxx1/2 into ospf db as lsa1
Area x range xxxy <<- this will force ABR to generate lsa3 only for xxxy ( aggregate subnet ) not for all subnets xxxx1/xxxx2
MHM
02-14-2025 12:26 AM
Hello
Area x Range xxxx is a ospf internal route summarisation feature performed on the ABR to summarise routes between ospf areas
Network xxx area x command enables ospf in a area on any interfaces that have ip addressing in the specified range stated in this command
02-13-2025 11:32 PM
You need both'
Network xxxx1/2 area x <<- will add xxxx1/2 into ospf db as lsa1
Area x range xxxy <<- this will force ABR to generate lsa3 only for xxxy ( aggregate subnet ) not for all subnets xxxx1/xxxx2
MHM
02-14-2025 12:26 AM
Hello
Area x Range xxxx is a ospf internal route summarisation feature performed on the ABR to summarise routes between ospf areas
Network xxx area x command enables ospf in a area on any interfaces that have ip addressing in the specified range stated in this command
02-14-2025 04:51 AM
"I am trying to understand when to use the command "area 0 range 10.0.0.0 0.0.255.255" instead of just the "network 10.0.0.0 0.0.255.255 area 0" with the topology shown below."
Ah, but that's not what you have below.
As the others have already noted, the purpose of the two configuration statements is quite different, and if you can see why your quoted statement isn't correct, it may further assist in understanding how different those two configuration statements are.
(BTW, I'm being a bit cryptic, as I believe when you find an error, yourself, it's a better learning experience - and this error has more applicability [so you too don't crash a large enterprise network, with entering one configuration command, that took requiring physical power cycling network devices to recover].)
02-14-2025 11:58 AM - edited 02-14-2025 12:28 PM
Thank you all for the solutions. I guess I got a little confused with static route summarization process, where you can just use x.x.x.x/16 network and will summarize all routes that fall within that range. However, with OSPF, I have tested with /8, /16, and /24 , plus the area to see if you could summarize it without using the "area X range" command, but It did not work. As MHM Cisco World mentioned, you have to use both commands. You have to create a more specific network with the /24 range per area, and then apply "area 0 range" command to summarize them. That way, the ABR's will only advertise the LSA3 to each router in a specific areas.
I also accepted Paul Diver's solution, because he summarizes what each command does and it is easy to comprehend. It builds on what MHM Cisco World had mentioned above.
Also, thank you Joseph for your input. You have a keen eye. I did noticed right after I posted this thread that I entered the command incorrectly "area 0 range 10.0.0.0 0.0.255.255" and we don't use wildcard masks with that area range command. A little inconsistency with Cisco's CLI. It should be "area 0 range 10.0.0.0 255.255.0.0" instead. However, this Cisco community does not have a button to edit your post after you have submitted the post, so I had to leave it that way. The actual commands below the description were correct though. I committed another misspelling as well, it should not be "Neil Anderson's CCNA trying" but "training.
Thank you all for your support and prompt replies.
02-14-2025 02:24 PM
@GabrielART wrote:
Also, thank you Joseph for your input. You have a keen eye. I did noticed right after I posted this thread that I entered the command incorrectly "area 0 range 10.0.0.0 0.0.255.255" and we don't use wildcard masks with that area range command. A little inconsistency with Cisco's CLI. It should be "area 0 range 10.0.0.0 255.255.0.0" instead. However, this Cisco community does not have a button to edit your post after you have submitted the post, so I had to leave it that way. The actual commands below the description were correct though. I committed another misspelling as well, it should not be "Neil Anderson's CCNA trying" but "training.
I'm very glad you noticed the error I was alluding to, including your mention that you noticed it when you first posted, and, at that time, did not know how to correct it, but possibly you didn't also get the importance of the syntax difference I was also trying to impute. I doubt it was just a Cisco CLI "little inconsistency".
Again, as the noted in the other replies, the two statements serve two very different purposes. Besides mask usage being different between the two statements, OSPF's classic network statement, does NOT indicate the networks you want to advertise within it. I mention this last, because those new to OSPF and/or exposed to how other Cisco routing protocols use their network statements, are different.
For example on R5:
int f0/1
ip address 10.0.3.2 255.255.255.0
router ospf 1
network 10.0.3.0 0.0.255.255 area 1
! *** or ***
network 10.0.3.2 0.0.0.0 area 1
! *** or ***
network 10.0.10.99 0.0.255.255 area 1
! *** or ***
network 10.0.0.0 0.0.3.255 area 1
! *** or ***
network 10.0.3.0 0.0.0.255 area 1
!above are just SOME of the network statement alternatives that would provide the same result on R5
For ABR summarization, the prefix/mask combination is more exacting.
BTW, in the later Cisco OSPF implementations, there's an alternative:
int f0/1
ip address 10.0.3.2 255.255.255.0
router ospf 1
network 0.0.0.0 255.255.255.255 area 1
! *** or ***
int f0/1
ip address 10.0.3.2 255.255.255.0
ip ospf 1 area 1
02-14-2025 02:38 PM
@GabrielART wrote:
Thank you all for the solutions. I guess I got a little confused with static route summarization process, where you can just use x.x.x.x/16 network and will summarize all routes that fall within that range. However, with OSPF, I have tested with /8, /16, and /24 , plus the area to see if you could summarize it without using the "area X range" command, but It did not work.
Hmm, are you trying to obtain something like RIP's or EIGRP's classful auto summarization?
Yes, you need the summarization statement, which isn't limited to classful boundaries.
I recall (???) it does require at least one active subordinate subnet to generate the summary.
It only works on ABR from a non-zero area to area zero.
It also can lead you into OSPF suboptimal routing issues in certain failure situations unless you plan your topology ideally.
02-14-2025 04:43 PM
I guess my confusion was that, if we look at area 1 of the topology, a network statement of 10.0.X.X/16 would cover all IP addresses within that area, for the IP addresses start to differ at the 17th bit of the addresses. This statement could be used on R2 for interface FE0/0 and R5 interface FE0/1 respectively. Same thing with area 0, we could use a network statement of 10.1.X.X/16 and it would cover all IP addresses within that area. This statement could be used on R2 for interface FE0/1 and R5 interface FE0/0 respectively. So, my idea was, if we use a network statement of /16 and define the area at the end of the network command (ie. R2(config-router)#network 10.0.0.0 0.0.255.255 area 0), it would do a summarization without having to enter the "area 0 range 10.0.0.0 255.255.0.0".
Also, my remark on the inconsistency of the Cisco CLI, is that all dynamic routing protocols use wildcard mask in their configuration, but in the "area 0 range 10.0.0.0 255.255.0.0", it chooses to use a regular mask. Not sure why, but it might have an explanation for it.
02-14-2025 06:13 PM
@GabrielART wrote:
I guess my confusion was that, if we look at area 1 of the topology, a network statement of 10.0.X.X/16 would cover all IP addresses within that area, for the IP addresses start to differ at the 17th bit of the addresses. This statement could be used on R2 for interface FE0/0 and R5 interface FE0/1 respectively. Same thing with area 0, we could use a network statement of 10.1.X.X/16 and it would cover all IP addresses within that area. This statement could be used on R2 for interface FE0/1 and R5 interface FE0/0 respectively.
Yes, the results for the shown topology are correct, but not exactly for the reason you seem (?) to infer.
Again, the classical OSPF network statement doesn't cover networks within an area, it covers interface IPs on that router, not even paying attention to the interface IP masks. I.e. it doesn't care a wit about the subnet.
For example you could use just network any-octet.any-octet.any-octet,any-octet 255.255.255.255 area # on all your routers except the ABRs. I.e. no need for a /16.
On the ABRs, you could use the above for either area, but the other area's interface would need a more specific network statement, which also doesn't need to be a /16.
What I'm trying to convey, is for the subnets in your network, picking them up has nothing to do with matching their /#. Basically that network statement works much like an ACL ACE to match an interface IP address, again, without concern to the interface IP address mask/subnet.
The OSPF ABR summarization statement mask, does define the network summary to be used. So, if, for example, you setup it up for 10.1.0.0/16, that's the network which will be seen by area zero, and the corresponding non zero area networks that fall within its scope, will not be seen within area zero.
As earlier noted, you may see both these statements, but they don't need to use the same mask, the statement pair would only be seen on an ABR, and in the newer injection syntax, the injection won't be in the OSPF router section, and it's effectively, a /32 match.
I guess what I've been trying to get across, when you read some text book example, or some lab example, they are very often simplified to emphasis a particular concept. You need to be very careful about making assumptions on how the discussed/shown technology fully works or might work.
Because these two OSPF statements were shown (?) using /16 masks (although slightly different syntax for specifications of the masks), you wondered if they could be combined. The answer is NO because they serve two very different purposes, work in different ways (both of those reasons, may account for the syntax being intentionally different).
Further, in this particular example case, yes you need both statements, but ABR summarization is an option, the interface IP matching network statement (not a network matching statement), certainly doesn't require the ABR summarization network statements, and in the newer OSPF implementations, the IP matching network statement might have been replaced by an OSPF statement within the interface config (like a /32 network statement).
BTW, when I initially flagged the initial error, also again, I was trying to highlight the syntax is different because those two OSPF network statements function is very different.
Also BTW, to your posted title, "When to use the range command in OSPF?" it's somewhat the converse of using OSPF stub areas.
02-17-2025 02:47 PM
Thank you Joseph for taking the time to clarify even further.
02-14-2025 01:08 PM
Nevermind, I found the button to edit. For who is reading this post and wondering how to edit the posts, look at the top right-hand corner of the post where there is an arrow button, and it should give a menu. I guess I have not looked hard enough. Amateur mistake.
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