Tuesday, October 11, 2011

Cracking the BGP ORIGIN Codes


The network above is setup to investigate how BGP generates the BGP ORIGIN codes.
RT2 advertises the route to 192.168.20.0/24 to RT1 with an origin of IGP, as the BGP route is originated within the AS – RT5 redistributes the static route into OSPF and advertises it to RT2.
RT3 advertises the route to 192.168.20.0/24 to RT1 with an origin of EGP, as the EGP route learned from AS 65005 is redistributed into BGP.
RT4 advertises the route to 192.168.20.0/24 to RT1 with an origin of incomplete, as the static route is actually being redistributed into BGP.
RT1#sh ip bgp summary
--- output omitted ---

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4 65002       9       9        3    0    0 00:04:10        1
3.3.3.3         4 65003       9      10        3    0    0 00:04:02        1
4.4.4.4         4 65004       9      10        3    0    0 00:04:07        1 
RT1#
RT1#sh ip route 192.168.0.0 255.255.0.0 longer-prefixes

Gateway of last resort is not set

C    192.168.10.0/24 is directly connected, Ethernet0/0
B    192.168.20.0/24 [20/20] via 2.2.2.2, 00:04:00
RT1#
RT1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 192.168.10.0     0.0.0.0                  0         32768 i
*  192.168.20.0     3.3.3.3                  1             0 65003 65005 e
*                   4.4.4.4                  0             0 65004 ?
*>                  2.2.2.2                 20             0 65002 i
RT1#

RT3 managed to advertise the EGP received from RT6 to RT1 with the BGP ORIGIN code of e.
RT3#sh ip route 192.168.0.0 255.255.0.0 longer-prefixes

Gateway of last resort is not set

B    192.168.10.0/24 [200/0] via 1.1.1.1, 00:04:39
E    192.168.20.0/24 [140/1] via 36.36.36.6, 00:00:39, Ethernet0/1
RT3#
RT3#sh ip egp
Local autonomous system is 65003

 EGP Neighbor     FAS/LAS  State    SndSeq RcvSeq Hello  Poll j/k Flags
*36.36.36.6      65005/65003 UP     0      1      0    60   180   3 Perm, Act 
RT3#
RT3#sh ip bgp
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 192.168.10.0     1.1.1.1                  0             0 65001 i
*> 192.168.20.0     36.36.36.6               1         32768 65005 e
*                   1.1.1.1                                0 65001 65002 i
RT3# 
RT3#sh ip bgp neighbors 1.1.1.1 advertised-routes
BGP table version is 4, local router ID is 3.3.3.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 192.168.20.0     36.36.36.6               1         32768 65005 e
RT3#

Below verifies that the network is operational through an extended ping on RT1.
RT1#ping 192.168.20.1 source 192.168.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.10.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/111/144 ms
RT1#

No comments:

Post a Comment