Recently I ran across a router with an interesting configuration. It had network <IP>, network <IP> mask <mask> and neighbor <IP> prefix-list <list> out commands, all for the same network.

Can anyone think of a reason for this? Is there a reason to have both a network <IP> mask <mask> statement and a neighbor <IP> prefix-list <list> out statement?

Is there something that the one does that the other doesn't?

On this site, they have the following configuration:

   ip prefix-list Summary permit le 20
   router bgp 65001
   neighbor prefix-list Summary out

Would this configuration work without a network statement? Would my example configuration above work without the prefix-list statement?


A prefix list doesn't actually advertise prefixes; it permits or denies prefixes that that the router can advertise (or use received prefixes, depending on the direction). The network statements will advertise the prefixes (assuming the exact routes exist in the routing table).

It appears that the configuration will let only prefixes smaller than /20 to be advertised. This is sometimes used because ISPs will only let smaller prefixes to be advertised on the public Internet. Most ISPs will not advertise any prefix longer than /24, and some ISPs many not even allow prefixes as long as that.

  • So in my first example, I could have network and then neighbor <IP> prefix-list <list> out with the list containing my company's IP block.
    – Lex
    Oct 3 '17 at 14:38
  • I don't understand your comment. The exact prefix of would need to exist in your routing table, but it is unlikely that an ISP would allow you to advertise a default prefix like that. A network statement will only advertise what already exists in your routing table, and it must be an exact match. You could use aggregate-address to advertise a smaller prefix than you have in the routing table, but you need to make sure that you control the entire smaller prefix, or your ISP will not allow you to advertise the aggregate.
    – Ron Maupin
    Oct 3 '17 at 14:46
  • So BGP is different from OSPF where you can do network area <area-id>?
    – Lex
    Oct 4 '17 at 15:05
  • The OSPF network statement tells OSPF which interfaces to include in the OSPF process; it does not tell OSPF what network to advertise. The BGP network statement tells BGP what network to advertise, but only if it already exist in the routing table.
    – Ron Maupin
    Oct 4 '17 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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