BGPRouter Config

redistribute connected

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

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.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions