Courseiva
BGPRouter Config

redistribute connected

Injects directly connected interface subnets into BGP for advertisement to peers.

Definition: redistribute connected is a Cisco IOS router config command. Redistributes directly connected routes into the BGP routing table. Useful for advertising interface subnets into BGP without the need to create a static route to Null0 for each prefix.

Syntax·Router Config
redistribute connected [route-map <map-name>]

When to Use This Command

  • Advertising all connected subnets into BGP for internet reachability.
  • Quick alternative to configuring individual 'network' statements.
  • Used with a route-map to filter which connected routes are redistributed.
  • Useful in lab environments to quickly inject test prefixes into BGP.

Command Examples

Redistribute all connected routes into BGP

R1(config)# router bgp 65001 R1(config-router)# redistribute connected
R1(config-router)#

All directly connected interface subnets are injected into BGP. Use with caution in production — this will advertise ALL connected subnets including management interfaces.

Filter redistribution with a route-map

R1(config)# ip prefix-list ADVERTISE seq 5 permit 198.51.100.0/24 R1(config)# route-map CONNECTED-TO-BGP permit 10 R1(config-route-map)# match ip address prefix-list ADVERTISE R1(config)# router bgp 65001 R1(config-router)# redistribute connected route-map CONNECTED-TO-BGP
R1(config-router)#

Only 198.51.100.0/24 is redistributed into BGP. The route-map filters out other connected subnets like loopbacks or management interfaces.

Understanding the Output

No direct output. Verify with 'show ip bgp' — redistributed routes appear with origin 'incomplete' (shown as '?') instead of 'IGP' ('i'). The '?' origin indicates the route came from redistribution, not a BGP 'network' statement.

Peers receive and install the routes normally regardless of origin.

CCNA Exam Tips

1.

CCNA exam tip: Routes redistributed into BGP show origin code '?' (incomplete). Routes added via 'network' show 'i' (IGP). The origin code affects BGP path selection.

2.

CCNA exam tip: Without a route-map filter, 'redistribute connected' advertises EVERYTHING including loopbacks — often undesirable.

3.

CCNA exam tip: 'redistribute connected' and 'network' can both be used simultaneously — they are not mutually exclusive.

4.

CCNA exam tip: The 'network' statement requires an exact match in the routing table; 'redistribute connected' is less precise but easier to configure.

Common Mistakes

Mistake 1: Using 'redistribute connected' without a route-map — advertises unintended subnets to peers.

Mistake 2: Confusing origin codes — redistribution produces '?' (incomplete), not 'i' (IGP) from network statement.

Mistake 3: Expecting redistributed routes to show up immediately — BGP may take up to the advertisement interval (30s eBGP) to send updates.

redistribute connected vs router bgp [asn]

Both commands are integral to BGP configuration on Cisco IOS, but they operate at different stages: 'router bgp [asn]' enters BGP configuration mode, while 'redistribute connected' is a subcommand used within that mode to inject directly connected routes. They are often discussed together because redistribution is a common BGP task, but they serve distinct purposes.

Aspectredistribute connectedrouter bgp [asn]
ScopeWithin BGP configurationGlobal configuration, then enters BGP config
Configuration modeRouter configuration (config-router)Global configuration (config)
FunctionRedistributes connected routes into BGPCreates/enters BGP process for an AS
DependenciesRequires active BGP processNo prior BGP configuration needed
EffectAdds connected prefixes to BGP tableStarts BGP routing process and config context
Typical useAdvertise directly connected interfacesBegin BGP configuration

Use 'redistribute connected' when you need to advertise the subnets of directly connected interfaces into the BGP routing table without static null routes.

Use 'router bgp [asn]' when you are starting a new BGP configuration or need to enter BGP router configuration mode to modify BGP settings.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions