OSPF "network x.x.x.x y.y.y.y area 1" question

walid97walid97 Member Posts: 79 ■■□□□□□□□□
Hi,

In the OSPF configuration, we type: "network 192.168.1.1 0.0.0.0 area 1"
but in RIP, IGRP, EIGRP we type: "network 192.168.1.0 .

I know what the 0.0.0.0 stabds for in OSPF as well as the area thing, my question is that in RIP, IGRP and EIGRP we added network address after "network" command. But in OSPF I noticed that we added interfaces not network addresses as in the other 3 protocols.

Is this how it is done? if so, why networks addresses were added in the 3 protocols and interface addresses were added in the case of OSPF..

thanks!

Comments

  • DrakonblaydeDrakonblayde Member Posts: 542
    the 0.0.0.0 in the ospf configuration is the wildcard mask. With RIP and IGRP (both classful routing protocols) you only add the network address that you're routing for. With OSPF it's a little bit different. The network address you specify along with the wildcard mask will determine which interface OSPF will route for. It's just the way OSPF operates. Let's say you specified it as

    network 192.168.1.1 0.0.0.255 area 1

    The router would then look for any interface with an ip in the range of 192.168.1.1 to 192.168.1.255 and use that for routing. Since your router should not be configured with two interfaces in the same subnet, this is a bit of a waste. By setting it to 192.168.1.1 0.0.0.0 area 1, all you're doing is explicitly defining which interface(s) the router will use for that ospf process.

    So yes, that's how it's done. Why? Because the powers that be said so hehe
    = Marcus Drakonblayde
    ================
    CCNP-O-Meter:
    =[0%]==[25%]==[50%]==[75%]==[100%]
    ==[X]===[X]====[ ]=====[ ]====[ ]==
    =CCNA==BSCI==BCMSN==BCRAN==CIT=
  • walid97walid97 Member Posts: 79 ■■□□□□□□□□
    The router would then look for any interface with an ip in the range of 192.168.1.1 to 192.168.1.255 and use that for routing.

    thanks dude, so it is better to use 0.0.0.0 (we specify a single interface, like a serial one that we know) instead of an entire range..
  • WebmasterWebmaster Admin Posts: 10,292 Admin
    OSPF is a Link State protocol, it keeps track of the 'state' of a 'link' (=interface).
  • walid97walid97 Member Posts: 79 ■■□□□□□□□□
    Webmaster wrote:
    OSPF is a Link State protocol, it keeps track of the 'state' of a 'link' (=interface).

    Yes, that's right.. forgot about this !!

    thank you
  • DrakonblaydeDrakonblayde Member Posts: 542
    Never thought about it that way webhead, thanks, that actually simplifies it for me too hehe

    But yeah, a common mistake I see people making is they think that the wildcard mask specifies which network that OSPF is routing for. Since that's the case with the distance vector's, I can understand where the misconception comes from. All you're really doing is telling OSPF what interfaces to route for
    = Marcus Drakonblayde
    ================
    CCNP-O-Meter:
    =[0%]==[25%]==[50%]==[75%]==[100%]
    ==[X]===[X]====[ ]=====[ ]====[ ]==
    =CCNA==BSCI==BCMSN==BCRAN==CIT=
  • PCHoldmannPCHoldmann Member Posts: 450
    My understanding is that you can also use the "RIP style" network command, using a wildcard mask like 0.0.0.255. This would add all interfaces in that network to OSPF, just like RIP, and you could expand the subnets included to get a range (0.0.3.255 would get the sam subnets as 255.255.252.0). One of the main reasons to do it by interface is the specification of area for ABRs (Area border routers). Narrowing it down to the interface might be the best bet if it comes up in the exam, but I am not sure about that, so if anyone knows...

    Peter
    There's no place like ^$
    Visit me at Route, Switch, Blog
  • forbeslforbesl Member Posts: 454
    As someone who uses OSPF regularly, I can tell you that the network statement is a range of IP addresses that you want to belong to the OSPF area. Generally this is the subnet directly connected to the interface (OR interfaces) you want OSPF to advertise.

    Here is Cisco's definition of a link state protocol:
    OSPF is a link-state routing protocol that calls for the sending of link-state advertisements (LSAs)
    to all other routers within the same hierarchical area. Information on attached interfaces (emphasis mine - in other words, the networks attached to the interfaces, not just the interface itself), metrics
    used, and other variables is included in OSPF LSAs. As OSPF routers accumulate link-state
    information, they use the SPF algorithm to calculate the shortest path to each node.

    If your CCNA is all that matters to you, then learn enough to pass the test....but if you want to know how it works in reality, you should study further:
    http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/ospf.htm

    http://www.cisco.com/univercd/cc/td/doc/product/software/ios121/121cgcr/ip_c/ipcprt2/1cdospf.htm#1005689
  • walid97walid97 Member Posts: 79 ■■□□□□□□□□
    so now, for the CCNA, can we use:
    "network 192.168.1.1 0.0.0.0 area 1"

    interface by interface? this is what the Sybex book says..
Sign In or Register to comment.