19 Route Advertisement

Before BGP can advertise a prefix, that prefix must be originated into BGP. There are three ways to introduce prefixes, and one important rule about how the network command behaves differently in BGP than in an IGP.

The three ways to originate a prefix

A prefix can be introduced into BGP by:

  • The network command: explicitly declares a prefix to advertise.
  • Redistribution: injects routes from another source (an IGP, connected, static) into BGP.
  • Aggregation: creates a summary prefix from more specific routes (covered in note 20).

Whichever method is used, the prefix is then carried to peers inside BGP Update messages.

The BGP network command: exact match

This is the key difference from an IGP. In BGP, the network command performs an exact match against the routing table: the prefix is advertised only if an exactly matching entry (same network and mask) already exists in the routing table.

If the prefix does not exist exactly as specified, BGP will not advertise it. This is unlike the IGP network command, which is used to select interfaces to run the protocol on. In BGP, network is purely about choosing which already-known prefixes to originate.

Because of the exact-match requirement, the mask must be specified precisely when the prefix is not classful.

Origin code implications

The method of origination is visible later in the BGP table through the Origin code:

  • network typically produces an i (IGP) origin.
  • Redistribution typically produces a ? (incomplete) origin.

This connects to reading the table (note 05) and to the Origin attribute (note 15): the origin code plus a next-hop of 0.0.0.0 reveals a locally originated prefix.

Locally originated preference

In best-path (step 3), locally originated routes are preferred, and among them a route originated by network or redistribution is preferred over one created by aggregation. This is why a router tends to prefer prefixes it introduced itself.

Self-check

Q1 — What are the three ways to originate a prefix into BGP?

A) network, redistribution, and aggregation
B) network, neighbor, and timers
C) eBGP, iBGP, and MP-BGP
D) Weight, Local Preference, and MED

Q2 — How does the BGP network command decide whether to advertise a prefix?

A) It runs BGP on the matching interfaces
B) It advertises only if an exactly matching entry exists in the routing table
C) It advertises any subnet of the given network
D) It always advertises the prefix regardless of the routing table

Q3 — A prefix redistributed into BGP typically shows which Origin code?

A) i (IGP)
B) e (EGP)
C) ? (Incomplete)
D) No origin code

Q4 — In best-path, among locally originated routes, which is preferred?

A) The aggregate over the network/redistributed route
B) The network/redistributed route over the aggregate
C) They are equal
D) The one with the highest MED