How to Configure BGP on a Cisco Router

Border Gateway Protocol (BGP) is the routing protocol of the internet — used between ISPs, enterprise WAN edges, and data centre interconnects. This guide covers basic eBGP and iBGP configuration on Cisco IOS routers.

What You Need

  • Cisco IOS router (ISR 4000 series, ASR 1000+, or Catalyst 8000)
  • Console / SSH access
  • BGP peer AS number, peer IP, network advertisements ready

Step-by-Step Instructions

  1. Step 1: Enter BGP routing process

    configure terminal router bgp <your-AS> ! Use your assigned AS number (private: 64512-65535, public: assigned by ARIN/RIPE)

  2. Step 2: Configure BGP router ID

    bgp router-id <unique-IPv4> ! Best practice: use a loopback interface IP. Each router needs a unique BGP router ID.

  3. Step 3: Establish BGP neighbor (peer)

    neighbor <peer-IP> remote-as <peer-AS> ! For eBGP, peer-AS differs from your AS. For iBGP, peer-AS equals your AS.

  4. Step 4: Configure update-source for iBGP

    neighbor <peer-IP> update-source Loopback0 ! iBGP peers should use loopback addresses for stability. Source loopback ensures the BGP session survives interface flaps.

  5. Step 5: Advertise networks via BGP

    network <network> mask <subnet-mask> ! Example: network 10.1.0.0 mask 255.255.0.0 ! Only advertises routes that exist in the routing table.

  6. Step 6: Apply route filtering (best practice)

    neighbor <peer-IP> prefix-list <name> in neighbor <peer-IP> prefix-list <name> out ! Filter incoming and outgoing routes. Critical for eBGP — never trust your peer's route advertisements blindly.

  7. Step 7: Verify BGP session

    show ip bgp summary ! Should show neighbor state = Established ! If stuck in Idle/Active/OpenSent, check IP reachability, AS numbers, MD5 password.

Frequently Asked Questions

What is the difference between eBGP and iBGP?

eBGP (external BGP) runs between routers in different Autonomous Systems (typically across an ISP boundary). iBGP (internal BGP) runs between routers in the same AS — used for full-mesh route distribution within an enterprise network. iBGP requires full-mesh or route-reflector topology.

Why is my BGP session stuck in Idle?

Most common causes: (1) IP not reachable (ping fails), (2) AS number mismatch on either side, (3) MD5 password mismatch, (4) eBGP TTL hop count exceeded (default 1 — increase with ebgp-multihop), (5) firewall blocking TCP 179.

Do I need a public AS number for internal BGP?

No — use a private AS number (64512-65535 for AS2 byte, 4200000000-4294967295 for AS4 byte). Private AS is hidden from internet routing tables by your ISP's edge routers.

Need the parts?

Pro Disk Network stocks all the parts referenced in this guide. Email sales@prodisknetwork.com with your server model — we will send a quote within one business day.

Part of

Enterprise Networking Hub

View all 128 pages →

Network switches, routers, firewalls, NICs, SFP and QSFP transceivers, DAC cables, wireless access points.