OSPF network command
altjx
Member Posts: 194
in CCNA & CCENT
I'm only curious about something. Does these two commands advertise the same thing on an OSPF network?
I see on this Boson exam environment, there's a router that's configured with the second command, and it advertises perfectly. What does the OSPF router advertise when the IP address is so specific like the second one?
network 10.1.2.0 0.0.0.3 area 0and
network 10.1.2.2 0.0.0.0 area 0
I see on this Boson exam environment, there's a router that's configured with the second command, and it advertises perfectly. What does the OSPF router advertise when the IP address is so specific like the second one?
CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA
Comments
-
jude56g Member Posts: 107 ■■■□□□□□□□I'm only curious about something. Does these two commands advertise the same thing on an OSPF network?
network 10.1.2.0 0.0.0.3 area 0
andnetwork 10.1.2.2 0.0.0.0 area 0
I see on this Boson exam environment, there's a router that's configured with the second command, and it advertises perfectly. What does the OSPF router advertise when the IP address is so specific like the second one?
network 10.1.2.0 0.0.0.3 area 0 advertises the /30 network (10.1.2.0 thru 10.1.2.4)
where as
network 10.1.2.2 0.0.0.0 area 0 advertises the /32, the specific host of 10.1.2.2
hope this helps. -
nel Member Posts: 2,859 ■□□□□□□□□□its as the OP says, one covers a range, the other a specific interface IP.
My preference is the specific /32 IP. Gives me more control of what should and shouldnt be enabled.Xbox Live: Bring It On
Bsc (hons) Network Computing - 1st Class
WIP: Msc advanced networking -
altjx Member Posts: 194Thanks for feedback, but for exam purposes, is it safe to always use the /32?
I mean in a huge network, using either command should advertise properly, correct?CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
jude56g Member Posts: 107 ■■■□□□□□□□Thanks for feedback, but for exam purposes, is it safe to always use the /32?
I mean in a huge network, using either command should advertise properly, correct?
It really depends what your trying to do. Are you trying to advertise a single IP or the /30 network? -
altjx Member Posts: 194It really depends what your trying to do. Are you trying to advertise a single IP or the /30 network?
Well, I think I'm wording this correctly. But let's say I have a router with FA0/0 192.168.1.1 /24..
Would it be necessary to advertise as "network 192.168.1.0 0.0.0.255 area 0" or "network 192.168.1.1 0.0.0.0 area 0"?CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
jude56g Member Posts: 107 ■■■□□□□□□□Well, I think I'm wording this correctly. But let's say I have a router with FA0/0 192.168.1.1 /24..
Would it be necessary to advertise as "network 192.168.1.0 0.0.0.255 area 0" or "network 192.168.1.1 0.0.0.0 area 0"?
The proper statement would be "network 192.168.1.0 0.0.0.255 area 0" -
altjx Member Posts: 194The proper statement would be "network 192.168.1.0 0.0.0.255 area 0"
Gotcha. Thanks!CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
altjx Member Posts: 194Wow... according to another test sim, the proper way is network 10.1.2.2 0.0.0.0 area 0 for a LAN that has the 10.1.2.0/24 subnet assigned... Omg wtf!
I understand that 10.1.2.2 is the IP address assigned to its LAN interface, but why is the network 10.1.2.2 0.0.0.0 area 0 command required instead of network 10.1.2.0 0.0.0.255 area 0?? that's so confusing!CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
alxx Member Posts: 755not directly related but interesting
Black Hat: Routers using OSPF open to attacksGoals CCNA by dec 2013, CCNP by end of 2014 -
pham0329 Member Posts: 556Wow... according to another test sim, the proper way is network 10.1.2.2 0.0.0.0 area 0 for a LAN that has the 10.1.2.0/24 subnet assigned... Omg wtf!
I understand that 10.1.2.2 is the IP address assigned to its LAN interface, but why is the network 10.1.2.2 0.0.0.0 area 0 command required instead of network 10.1.2.0 0.0.0.255 area 0?? that's so confusing!
It depends on what you want to do. If you want to enable OSPF on any interface that starts with 10.1.2.0, then you would use your method. However, it's generally best practice to use a 0.0.0.0 mask to avoid any confusion, and to prevent any unwanted interface from running OSPF. -
altjx Member Posts: 194not directly related but interesting
Black Hat: Routers using OSPF open to attacks
Interesting article. Thank you I'm actually in IT Security so this is pretty good knowledgeCompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
SharkDiver Member Posts: 844network 10.1.2.0 0.0.0.3 area 0 advertises the /30 network (10.1.2.0 thru 10.1.2.4)
Just a small correction.
The subnet would actually only cover 10.1.2.0 thru 10.1.2.3
A cool tip that I learned in the CCNP Route material is that you can add the network to the wildcard mask to find the range.
Examples:
10.1.2.0 0.0.0.3 = 10.1.2.0 thru 10.1.2.3
192.168.1.0 0.0.0.15 = 192.168.1.0 thru 192.168.1.15
172.16.10.0 0.0.0.31 = 172.16.10.0 thru 172.16.10.31
It even works on non-zero networks.
172.16.10.64 0.0.0.31 = 172.16.10.64 thru 172.16.10.95 -
altjx Member Posts: 194SharkDiver wrote: »network 10.1.2.0 0.0.0.3 area 0 advertises the /30 network (10.1.2.0 thru 10.1.2.4)
Just a small correction.
The subnet would actually only cover 10.1.2.0 thru 10.1.2.3
A cool tip that I learned in the CCNP Route material is that you can add the network to the wildcard mask to find the range.
Examples:
10.1.2.0 0.0.0.3 = 10.1.2.0 thru 10.1.2.3
192.168.1.0 0.0.0.15 = 192.168.1.0 thru 192.168.1.15
172.16.10.0 0.0.0.31 = 172.16.10.0 thru 172.16.10.31
It even works on non-zero networks.
172.16.10.64 0.0.0.31 = 172.16.10.64 thru 172.16.10.95
Very interesting man. I thought of something like this similar too when I was reading it. It made perfect sense, but I just didn't want to get confused. But I guess I wasn't the only one, lol. This will be very helpful! Thank you! This will save me a lot of seconds (which means a lot on CCNA exam I presume)CompTIA: A+, Security+, Network+
Microsoft: MCTS: Windows 7, Configuring, MCTS: Windows Server 2008 Applications Infrastructure, Configuring
Cisco: CCENT, CCNA -
jude56g Member Posts: 107 ■■■□□□□□□□It depends on what you want to do. If you want to enable OSPF on any interface that starts with 10.1.2.0, then you would use your method. However, it's generally best practice to use a 0.0.0.0 mask to avoid any confusion, and to prevent any unwanted interface from running OSPF.
This is pretty interesting, I have never seen a configuration like that. I have always used the inverse mask that matched the subnet on the interface in question.
I'll have to lab this out to confirm, but I think if you advertise 10.2.2.2 0.0.0.0 area 0, the other routers in area 0 will only add the /32 to their routing table as opposed to the entire /24 network. So the router that receives this update will have a route to 10.2.2.2/32 but not to the other addresses in the /24.
Any thoughts on my theory? : -
SharkDiver Member Posts: 844The network statement only decides which interfaces to enable for OSPF and which area to place them in, not what is advertised.
As a shortcut, if you have a router and you want all of the interfaces OSPF enabled and placed into area 0, you can actually use this:
R1(config-router)#network 0.0.0.0 255.255.255.255 area 0 -
pham0329 Member Posts: 556This is pretty interesting, I have never seen a configuration like that. I have always used the inverse mask that matched the subnet on the interface in question.
I'll have to lab this out to confirm, but I think if you advertise 10.2.2.2 0.0.0.0 area 0, the other routers in area 0 will only add the /32 to their routing table as opposed to the entire /24 network. So the router that receives this update will have a route to 10.2.2.2/32 but not to the other addresses in the /24.
Any thoughts on my theory? :
As SharkDriver said, the network command only determines what interface is actively participating in OSPF. The actual network advertised is the one assigned to that interface.
When you lab this out, make sure that if you're advertising a loopback, you change the OSPF network type on the loopback or else it will advertise a /32 no matter what you do.