Options

OSPF question

AgisAgis Member Posts: 3 ■■■□□□□□□□
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? icon_confused.gif:

Thanks
*edit- I accidentally used 127 instead of 31 in my original post*

Comments

  • Options
    BennyLavaBennyLava 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.
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    Agis wrote: »
    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.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? icon_confused.gif:
    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
  • Options
    blackninjablackninja Member Posts: 385
    BennyLava wrote: »
    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.

    Just tested on lab and I'll be damned.

    I love this site - learn something everyday :)
    Currently studying:
    CCIE R&S - using INE workbooks & videos

    Currently reading:
    Everything. Twice ;)
  • Options
    kryollakryolla Member Posts: 785
    it also works for eigrp
    Studying for CCIE and drinking Home Brew
  • Options
    creamy_stewcreamy_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.
    Itchy... Tasty!
    [X] DCICN
    [X] IINS

    [ ] CCDA
    [ ] DCICT
  • Options
    tim100tim100 Member Posts: 162
    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
  • Options
    Forsaken_GAForsaken_GA Member Posts: 4,024
    tim100 wrote: »
    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

    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.
  • Options
    blackninjablackninja Member Posts: 385
    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 ;)
Sign In or Register to comment.