• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Consultant

  • Network Automation
    • Network Automation Consultant
    • Network Automation Courses
    • What is NetDevOps?
    • Workflow Orchestration
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Inventory Example
    • Python Network Automation
      • Nornir
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox Training
      • Infrahub
      • NautoBot
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

BGP Peer in wrong AS

Home » BGP Protocol

When configuring BGP with a remote peer you might get the error message
BGP peer in wrong AS

*Apr 18 08:39:15.455: %BGP-3-NOTIFICATION: received from neighbor 10.0.12.2
passive 2/2 (peer in wrong AS) 2 bytes 0002

This means that you have mis-matched AS numbers in your BGP configuration.

You can phone up the remote end and ask them what their AS number is. But if you cannot do that there is one way.

The answer to this problem is given to you in the log message.

The HEX number at the end of the log message 0002 is telling you that the remote AS is 2

If you change your neighbor statement to be 2 the peering should come up.

R1#sh run | sec router bgp
router bgp 1
no synchronization
bgp log-neighbor-changes
neighbor 10.0.12.2 remote-as 5  (Neighbor set to 5 - wrong)

Just change your neighbor statement to point to AS 2 and the peering shoudl come up.

R1(config)#router bgp 1
R1(config-router)#no neighbor 10.0.12.2 remote-as 5
R1(config-router)#neighbor 10.0.12.2 remote-as 2
R1#
*Mar  1 00:13:59.539: %BGP-5-ADJCHANGE: neighbor 10.0.12.2 Up
R1#

This will not help you if the neighbor statement on the remote end is incorrect.

If the Hex number is larger you can use the windows calculater in programmer mode to convert betwen hex and decimal

Further Reading on BGP

BGP Confederation vs Route Reflector

Category: BGP ProtocolTag: bgp
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:ccna certification requirements certifications triangle from ccent to ccarHow to become a network engineer with no experience
Next Post:Awesome Putty tips and tricks for work and the CCIE Lab!

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

Python for Network Engineers Course

Topics

Network Automation
Ansible Network Automaton
Python for Network Automation
CCIE
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Python VENV Tutorial
Python for Network Engineers Course

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
What is Ansible?
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2026 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms