Professional Documents
Culture Documents
BGP Origin Code Attribute Explained
BGP Origin Code Attribute Explained
The BGP Origin Code is one of the attributes that is used for path selection. There are
three origin codes that the BGP table can show:
Above you can see the topology that I will use. R1 and R3 are in AS1 and connected to
R2 in AS2. Both routers have a loopback0 interface with network 1.1.1.0/24 configured
on it.
R1(config)#router bgp 1
R1(config-router)#neighbor 192.168.12.2 remote-as 2
R3(config)#router bgp 1
R3(config-router)#neighbor 192.168.23.2 remote-as 2
R2(config)#router bgp 2
R2(config-router)#neighbor 192.168.12.1 remote-as 1
R2(config-router)#neighbor 192.168.23.3 remote-as 1
First we’ll configure BGP. Next step is to get network 1.1.1.0/24 in the BGP table:
R1(config)#router bgp 1
R1(config-router)#network 1.1.1.0 mask 255.255.255.0
R3(config)#router bgp 1
R3(config-router)#redistribute connected
On R1 I’ll advertise network 1.1.1.0/24 in BGP with the network command, on R3 we’ll
redistribute it. Let’s see what R2 thinks of this…
R2#show ip bgp
BGP table version is 4, local router ID is 192.168.23.2
Status codes: s suppressed, d damped, h history, * valid, > best, i
- internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
In the output above you can see that R2 learned both networks through BGP. There’s
one small difference however. The first entry shows a ? symbol and the second entry
shows an ‘i’.