OSPF question
Agis
Member Posts: 3 ■■■□□□□□□□
in CCNA & CCENT
Hey all,
I was doing an OSPF lab and I used these commands after enabling OSPF on RouterA:
#router ospf 100
#network 172.19.0.161 255.255.255.224 area 0
Now this "lab" is a Testout sim. It accepted the command and when I used the "show ip route" command the network address showed up on RouterB correctly. The sim said I correctly configured the routers. When reviewing I saw that I should have used-
#network 172.19.0.0 0.0.0.31 area 0
...using the wildcard mask. Question- Can you do it both ways? ...or is the sim incorrect and real routers would be configured incorrectly? :
Thanks
*edit- I accidentally used 127 instead of 31 in my original post*
I was doing an OSPF lab and I used these commands after enabling OSPF on RouterA:
#router ospf 100
#network 172.19.0.161 255.255.255.224 area 0
Now this "lab" is a Testout sim. It accepted the command and when I used the "show ip route" command the network address showed up on RouterB correctly. The sim said I correctly configured the routers. When reviewing I saw that I should have used-
#network 172.19.0.0 0.0.0.31 area 0
...using the wildcard mask. Question- Can you do it both ways? ...or is the sim incorrect and real routers would be configured incorrectly? :
Thanks
*edit- I accidentally used 127 instead of 31 in my original post*
Comments
-
BennyLava Member Posts: 60 ■■□□□□□□□□A real router accepts either but a subnet mask will be automatically converted to a wildcard mask in the config
R2(config-router)#net 172.19.0.161 255.255.255.224 area 0
R2(config-router)#do sh run | section router
router ospf 1
log-adjacency-changes
network 172.19.0.160 0.0.0.31 area 0
For exam purposes, you would probably want to enter it with a wildcard mask in case the sim doesn't behave the same way. -
Forsaken_GA Member Posts: 4,024Hey all,
I was doing an OSPF lab and I used these commands after enabling OSPF on RouterA:
#router ospf 100
#network 172.19.0.161 255.255.255.224 area 0
Now this "lab" is a Testout sim. It accepted the command and when I used the "show ip route" command the network address showed up on RouterB correctly. The sim said I correctly configured the routers. When reviewing I saw that I should have used-
#network 172.19.0.0 0.0.0.127 area 0
...using the wildcard mask. Question- Can you do it both ways? ...or is the sim incorrect and real routers would be configured incorrectly? :
Thanks
Interesting question, I'll have to lab it up and see what the result is.
Your wildcard mask basically told OSPF it's cool to use any inteface which has an an address with the last five bits set to 00001. This could have unforseen circumstances.
The more specific wildcard mask of 0.0.0.127 tells OSPF that it's cool to use any interface with an IP between 172.19.0.128 and 172.19.0.255
Edit - yeah, nevermind, IOS accounts for user mistakes, if you enter 255.255.255.224, it'll convert it to 0.0.0.31 -
blackninja Member Posts: 385A real router accepts either but a subnet mask will be automatically converted to a wildcard mask in the config
R2(config-router)#net 172.19.0.161 255.255.255.224 area 0
R2(config-router)#do sh run | section router
router ospf 1
log-adjacency-changes
network 172.19.0.160 0.0.0.31 area 0
For exam purposes, you would probably want to enter it with a wildcard mask in case the sim doesn't behave the same way.
Just tested on lab and I'll be damned.
I love this site - learn something everydayCurrently studying:
CCIE R&S - using INE workbooks & videos
Currently reading:
Everything. Twice -
creamy_stew Member Posts: 406 ■■■□□□□□□□Wow, you just blew my mind! I had no idea you could do it like that!
I'll be using that. -
tim100 Member Posts: 162Forsaken_GA wrote: »The more specific wildcard mask of 0.0.0.127 tells OSPF that it's cool to use any interface with an IP between 172.19.0.128 and 172.19.0.255
He specified 172.19.0.0 0.0.0.127 so it would actually be any interface with an IP ranging from 172.19.0.1 to 172.19.0.126 -
Forsaken_GA Member Posts: 4,024He specified 172.19.0.0 0.0.0.127 so it would actually be any interface with an IP ranging from 172.19.0.1 to 172.19.0.126
Ah damn, I missed the last octet being .0 in the second specification.
Alright, so if the interface had the IP 172.19.0.161, and he used
network 172.19.0.0 0.0.0.127 area [x]
That would result in the interface with 172.169.0.161 not participating in OSPF. -
blackninja Member Posts: 385Forsaken_GA wrote: »Ah damn, I missed the last octet being .0 in the second specification.
Alright, so if the interface had the IP 172.19.0.161, and he used
network 172.19.0.0 0.0.0.127 area [x]
That would result in the interface with 172.169.0.161 not participating in OSPF.
That right you would need to use
network 172.19.0.128 0.0.0.127 area X
Range: 172.19.0.128 - 172.19.0.255
Could use: network 172.19.0.160 0.0.0.31 area 0
An long as the 161 is inc in the range it would be fine.Currently studying:
CCIE R&S - using INE workbooks & videos
Currently reading:
Everything. Twice