neighbor [ip] remote-as [asn]
Defines a BGP neighbor peer relationship by IP address and remote AS number.
neighbor <ip-address> remote-as <autonomous-system-number>When to Use This Command
- Configuring an eBGP peer to an ISP router.
- Setting up iBGP full mesh within the same AS.
- Adding a new peer to an existing BGP process.
- Connecting two enterprise networks using private AS numbers.
Command Examples
eBGP to ISP (different AS number)
R1(config)# router bgp 65001
R1(config-router)# neighbor 203.0.113.1 remote-as 100R1(config-router)# %BGP-5-ADJCHANGE: neighbor 203.0.113.1 Up
The session establishes when the peer is reachable and configured correctly. AS 100 (ISP) differs from AS 65001 (local), making this an eBGP session. The syslog message confirms the adjacency came up.
iBGP between two routers in the same AS
R1(config)# router bgp 65001
R1(config-router)# neighbor 10.0.0.2 remote-as 65001R1(config-router)#
Both routers use the same AS (65001), creating an iBGP session. iBGP peers are usually loopback-sourced and require 'neighbor update-source' for stability.
Understanding the Output
No direct output from the command. Verify the neighbor relationship with 'show ip bgp summary'. Look for the State/PfxRcd column — 'Established' shows as a number of received prefixes (e.g., 5), while a failing session shows Idle, Active, Connect, or OpenSent.
CCNA Exam Tips
CCNA exam tip: eBGP = different AS numbers; iBGP = same AS numbers. The exam tests this distinction.
CCNA exam tip: eBGP neighbors must be directly connected (TTL=1 by default). iBGP uses 'neighbor update-source Loopback0' and 'neighbor ebgp-multihop' for non-direct paths.
CCNA exam tip: Both routers must configure each other as a neighbor — BGP is not auto-discovered.
CCNA exam tip: If 'show ip bgp summary' shows 'Active' state, the most common causes are wrong IP, wrong AS number, or firewall blocking TCP 179.
Common Mistakes
Mistake 1: Specifying the wrong remote-as — the session negotiation fails (BGP OPEN message mismatch).
Mistake 2: Only configuring one side of the peering — both routers must have 'neighbor' statements.
Mistake 3: For iBGP: not using a loopback update source — if the direct link goes down, the iBGP session drops even if another path exists.
Related Commands
neighbor [ip] update-source [interface]
Specifies the source interface for BGP TCP sessions to a neighbor. Used in iBGP configurations to source sessions from a loopback interface for stability — if the physical link fails but another path exists, the loopback remains reachable and the session stays up.
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 summary
Displays a summary of the BGP neighbor status and prefix counts, used to quickly verify BGP peering and routing table health.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions