BGPRouter Config

neighbor [ip] remote-as [asn]

Defines a BGP neighbor peer relationship by IP address and remote AS number.

Syntax·Router Config
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 100
R1(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 65001
R1(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

1.

CCNA exam tip: eBGP = different AS numbers; iBGP = same AS numbers. The exam tests this distinction.

2.

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.

3.

CCNA exam tip: Both routers must configure each other as a neighbor — BGP is not auto-discovered.

4.

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

Practice for the CCNA 200-301

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

Practice CCNA Questions