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
networkcommand: 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:
networktypically produces ani(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, andtimers
C) eBGP, iBGP, and MP-BGP
D) Weight, Local Preference, and MED
Respuesta
A is correct. A prefix is introduced by the
networkcommand, by redistribution, or by aggregation.
- B) False —
neighborandtimersconfigure sessions, not origination.- C) False — those are peer/protocol types, not origination methods.
- D) False — those are path attributes, not ways to originate.
Q2 — How does the BGP
networkcommand 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
Respuesta
B is correct. BGP’s
networkperforms an exact match against the routing table; the prefix is advertised only if it exists exactly (network and mask).
- A) False — selecting interfaces is the IGP
networkbehavior.- C) False — it requires an exact match, not any subnet.
- D) False — without a matching routing-table entry, it is not advertised.
Q3 — A prefix redistributed into BGP typically shows which Origin code?
A)
i(IGP)
B)e(EGP)
C)?(Incomplete)
D) No origin code
Respuesta
C is correct. Redistribution typically produces a
?(incomplete) origin, since the true origin is unknown.
- A) False —
itypically results from thenetworkcommand.- B) False —
eis the legacy EGP code, rarely seen.- D) False — every BGP route carries an origin code.
Q4 — In best-path, among locally originated routes, which is preferred?
A) The aggregate over the
network/redistributed route
B) Thenetwork/redistributed route over the aggregate
C) They are equal
D) The one with the highest MED
Respuesta
B is correct. At step 3, a route originated by
networkor redistribution is preferred over one created by aggregation.
- A) False — aggregate is the less preferred of the two.
- C) False — there is a defined preference.
- D) False — MED is a later, unrelated step.