2

I have learned that, in routing config, a router must advertise all of its networks.

For example, in this topo:

enter image description here

Router A need to network 192.168.1.1 0.0.0.255 and network 100.1.1.2 0.0.0.255

But why need to network 100.1.1.2 0.0.0.255?

I mean, if A only advertise 192.168.1.0, then B received it and think: "OH ok, A has that network, so when I need to send anything to 192.168.1.0, I just forward it to A, which is my interface F0/0". Cause they are directly connected, so B must knows A's IP address(next hop),right?

I must be wrong, I just don't know how. Cause I tested my self, it won't work.

2 Answers 2

3

I think you misunderstand the OSPF and EIGRP network statement. The network statement does not advertise a network, it tells the routing protocol which interface(s) to include in the routing protocol process. The network(s) configured on the participating interface(s) is what gets advertised. For example, you could simply advertise network 0.0.0.0 255.255.255.255, and that will include all the interfaces in the routing protocol, but it only advertises the networks configured on the interfaces.

For the interfaces where routers are not connected, you can use the passive interface command to still advertise the interface network without sending routing protocol information out the interface (no OSPF hellos), and that is a best practice.

On the other hand, BGP uses network statements to advertise the networks, but only if the exact match is already found in the routing table.

4
  • thanks, but I am still a little confused. so if every interface is actually a subnet that involves routing, network 0.0.0.0 255.255.255.255 is a valid way to simply advertise all of my router's subnet?
    – scriptboy
    Mar 22 at 4:14
  • and "For the interfaces where routers are not connected", I don't understand, how can I have an interface which I don't connect? thank you.
    – scriptboy
    Mar 22 at 4:16
  • "if every interface is actually a subnet that involves routing, network 0.0.0.0 255.255.255.255 is a valid way to simply advertise all of my router's subnet?" Yes, as I explained in my answer. Also, your 192.168.1.0/24 and 10.2.2.9.24 networks do not need to have routing protocol traffic as there are no other routers on those networks to advertise the to which you would advertise other networks.
    – Ron Maupin
    Mar 22 at 4:35
  • 1
    @scriptboy, as I explained, you are not advertising the networks with network statement, you are including interfaces in the routing protocols. The routing protocols will gather the networks to advertise from the networks configured on the interfaces participating in the routing protocols.
    – Ron Maupin
    Mar 22 at 4:37
1

I don't understand, how can I have an interface which I don't connect?

Interfaces that are connected to hosts (PCs) don't have any routers connected and therefore don't need to send hellos. Also, in your simple network, you only have two routers running one routing protocol (OSPF). But in larger, more complex networks, you can have other routing protocols and you may want to restrict witch protocols use specific interfaces. For example, you probably don't want to send OSPF hellos to the Internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.