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