feature bgp
Enables the BGP routing protocol on the Cisco NX-OS device.
Overview
The 'feature bgp' command is the first step in configuring BGP on Cisco Nexus switches running NX-OS. BGP (Border Gateway Protocol) is the de facto exterior gateway protocol used for routing between autonomous systems (AS). In data center environments, BGP is increasingly used for fabric underlay and overlay (e.g., VXLAN EVPN) due to its scalability and policy control. On NX-OS, BGP is not enabled by default; it must be explicitly turned on using this command. Once enabled, the BGP process starts and you can enter BGP configuration mode with 'router bgp <ASN>'. This command is global and affects the entire switch. It is typically one of the first commands in a BGP configuration sequence. Without it, any BGP-related commands will be rejected. The command does not require any parameters. Disabling BGP with 'no feature bgp' removes all BGP configuration, so caution is advised. In troubleshooting workflows, verifying that BGP is enabled is a critical first step when BGP sessions are not forming.
feature bgpWhen to Use This Command
- Enabling BGP on a Nexus switch to peer with an upstream ISP router.
- Activating BGP for a data center leaf-spine fabric using EVPN.
- Turning on BGP to exchange routes with a firewall in a DMZ network.
- Enabling BGP for MPLS L3VPN service provider edge routers.
Parameters
| Parameter | Syntax | Description |
|---|---|---|
| None | feature bgp | This command has no parameters. It simply enables the BGP feature on the device. |
Command Examples
Enable BGP Feature
configure terminal
feature bgpswitch# configure terminal switch(config)# feature bgp switch(config)#
The command enters global configuration mode and enables the BGP feature. No output indicates success.
Verify BGP Feature Status
show feature | include bgpbgp 1 enabled
The output shows that BGP is enabled (1=enabled). If disabled, it would show '0' and 'disabled'.
Understanding the Output
The 'feature bgp' command itself produces no output on success. To verify, use 'show feature | include bgp'. The output shows a line with 'bgp', instance number (1), and status ('enabled' or 'disabled'). A healthy state is 'enabled'. If 'disabled', BGP is not active and no BGP configuration will take effect. The instance number is always 1 for the default BGP process.
Configuration Scenarios
Basic BGP Enable for ISP Peering
A Nexus switch in a colocation facility needs to peer with an ISP router.
Topology
[ISP Router] --- (eBGP) --- [Nexus Switch]Steps
- 1.Enter global configuration mode.
- 2.Enable the BGP feature.
- 3.Configure BGP router with the local AS number.
! Enable BGP feature
configure terminal
feature bgp
! Configure BGP router
router bgp 65001
neighbor 10.0.0.1 remote-as 65000
address-family ipv4 unicast
network 192.168.1.0/24Verify: Use 'show ip bgp summary' to verify the BGP session is established.
Watch out: If 'feature bgp' is not entered first, the 'router bgp' command will fail.
Troubleshooting with This Command
When BGP sessions are not coming up, first verify that BGP is enabled using 'show feature | include bgp'. If it shows 'disabled', enable it with 'feature bgp'. If it shows 'enabled' but sessions are down, check BGP configuration, network reachability, and timers. On NX-OS, BGP feature enablement is a prerequisite; missing it is a common oversight. Also, note that disabling BGP with 'no feature bgp' will wipe all BGP configuration, so use with care. For persistent issues, check system logs with 'show logging | include bgp'.
CCNA Exam Tips
Remember that 'feature bgp' must be issued before any BGP configuration commands.
On NX-OS, BGP is a feature that must be enabled; it is not on by default unlike some IOS versions.
Use 'no feature bgp' to disable BGP, which removes all BGP configuration.
Common Mistakes
Forgetting to enable the BGP feature before configuring BGP; results in 'Invalid command' errors.
Assuming BGP is enabled by default; it is not on NX-OS.
Using 'router bgp' without first enabling the feature; the command will be rejected.
Platform Notes
On Cisco IOS, BGP is typically enabled by default or via 'router bgp' directly. On NX-OS, the 'feature bgp' command is mandatory. This is similar to other NX-OS features like OSPF or EIGRP. The command is available from NX-OS version 5.0 onwards. On Cisco IOS-XR, BGP is enabled by default in the configuration mode. Always check the specific NX-OS version for any nuances.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions