redistribute connected
Injects directly connected interface subnets into BGP for advertisement to peers.
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 connectedR1(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-BGPR1(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
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.
CCNA exam tip: Without a route-map filter, 'redistribute connected' advertises EVERYTHING including loopbacks — often undesirable.
CCNA exam tip: 'redistribute connected' and 'network' can both be used simultaneously — they are not mutually exclusive.
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
network [network] mask [mask]
Advertises a network into BGP. The specified network must exist in the local routing table (via static route, connected, or IGP) for BGP to originate and advertise it.
router bgp [asn]
Enters BGP router configuration mode and creates a BGP process with the specified autonomous system (AS) number. This is the first command required to configure BGP on a Cisco router.
show ip bgp
Displays the BGP routing table, showing learned BGP routes and their attributes, used for troubleshooting BGP path selection and verifying route advertisement.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions