Saturday, May 26, 2018

Challenge: BGP - UPDATE!

After posting my original solution to the BGP challenge ( https://www.youtube.com/watch?v=YxUgYVb-91I ) I was called out by none other than the man himself, Mr. Vinit Jain!


I went back and took another look at his video and he alludes to the answer at around 1:35 (1 hour, 35 minute) ( https://www.ciscolive.com/global/on-demand-library/?search=BRKRST%203320#/video/1519328378542002IVEW ).


The Challenge:


The Solution:



The Configs:


R1:


hostname R1

interface Loopback100
 ip address 100.1.1.1 255.255.255.255

interface FastEthernet0/0
 description "To R2"
 ip address 10.1.12.1 255.255.255.0


router bgp 100
 bgp log-neighbor-changes
 network 100.1.1.1 mask 255.255.255.255
 neighbor 10.1.12.2 remote-as 200




R2:


hostname R2

interface FastEthernet0/0
 description "To R1"
 ip vrf forwarding 200
 ip address 10.1.12.2 255.255.255.0

interface FastEthernet1/0
 description "To R3"
 ip vrf forwarding 200
 ip address 10.1.23.2 255.255.255.0


router bgp 200
 bgp log-neighbor-changes
 neighbor 10.1.12.1 remote-as 100
 neighbor 10.1.23.3 remote-as 200
 neighbor 10.1.23.3 next-hop-self



R3:


hostname R3

interface FastEthernet0/0
 description "To R4"
 ip address 10.1.34.3 255.255.255.0

interface FastEthernet1/0
 description "To R2"
 ip address 10.1.23.3 255.255.255.0


router bgp 200
 bgp log-neighbor-changes
 bgp inject-map INJECT exist-map EXIST
 neighbor 10.1.23.2 remote-as 200
 neighbor 10.1.34.4 remote-as 200
 neighbor 10.1.34.4 route-reflector-client

ip prefix-list LEARNED seq 5 permit 100.1.1.1/32
ip prefix-list NEIGHBOR seq 5 permit 10.1.23.2/32
ip prefix-list ORIGINATE seq 5 permit 100.1.1.1/32

route-map INJECT permit 10
 set ip address prefix-list ORIGINATE
 set ip next-hop 10.1.34.3

route-map EXIST permit 10
 match ip address prefix-list LEARNED
 match ip route-source prefix-list NEIGHBOR


Verify:


R3#sho ip bgp injected-paths

BGP table version is 3, local router ID is 10.1.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 100.1.1.1/32     10.1.34.3                              0 ?

R3#sho ip bgp
BGP table version is 3, local router ID is 10.1.34.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 100.1.1.1/32     10.1.34.3                              0 ?
 * i                  10.1.23.2                0    100      0 100 i



R4:


hostname R4

interface FastEthernet0/0
 description "To R3"
 ip address 10.1.34.4 255.255.255.0

interface FastEthernet1/0
 description "To R5"
 ip address 10.1.45.4 255.255.255.0


router bgp 200
 bgp log-neighbor-changes
 neighbor 10.1.34.3 remote-as 200
 neighbor 10.1.45.5 remote-as 300



Verify:



R4#sho ip bgp

BGP table version is 2, local router ID is 10.1.45.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 100.1.1.1/32     10.1.34.3                     100      0 ?




R5:


hostname R5

interface FastEthernet1/0
 description "To R4"
 ip address 10.1.45.5 255.255.255.0


router bgp 300
 bgp log-neighbor-changes
 neighbor 10.1.45.4 remote-as 200



R5 - Verify:


R5#sho ip bgp

BGP table version is 2, local router ID is 10.1.45.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  100.1.1.1/32     10.1.45.4                              0 200 ?
R5#

Wednesday, May 23, 2018

Challenge: BGP

I was hanging out in theLANtamer's Discord server and a friend showed me this challenge.

I later found out after I had completed the challenge, it was a BGP challenge from the Great Vinit Jain (https://twitter.com/vinugenie) from his Cisco Live presentation, at around 12 minutes in: ( https://www.ciscolive.com/global/on-demand-library/?search=BRKRST%203320#/video/1519328378542002IVEW )


The Challenge:


The Solution:


The Configs:


R1:



hostname R1

interface Loopback100
 ip address 100.1.1.1 255.255.255.255

interface FastEthernet0/0
 description "To R2"
 ip address 10.1.12.1 255.255.255.0


router bgp 100
 bgp log-neighbor-changes
 network 100.1.1.1 mask 255.255.255.255
 neighbor 10.1.12.2 remote-as 200


R2:



hostname R2

ip vrf 200
 rd 200:200


interface FastEthernet0/0
 description "To R1"
 ip vrf forwarding 200
 ip address 10.1.12.2 255.255.255.0

interface FastEthernet1/0
 description "To R3"
 ip vrf forwarding 200
 ip address 10.1.23.2 255.255.255.0


router bgp 200
 bgp log-neighbor-changes
 !
 address-family ipv4 vrf 200
  neighbor 10.1.12.1 remote-as 100
  neighbor 10.1.12.1 activate
  neighbor 10.1.23.3 remote-as 100
  neighbor 10.1.23.3 activate
  neighbor 10.1.23.3 as-override
 exit-address-family


R3:


hostname R3

interface FastEthernet0/0
 description "To R4"
 ip address 10.1.34.3 255.255.255.0

interface FastEthernet1/0
 description "To R2"
 ip address 10.1.23.3 255.255.255.0

router bgp 250
 bgp log-neighbor-changes
 neighbor 10.1.23.2 remote-as 200
 neighbor 10.1.23.2 local-as 100 no-prepend replace-as
 neighbor 10.1.34.4 remote-as 200
 neighbor 10.1.34.4 local-as 200 no-prepend replace-as


R4:


hostname R4

interface FastEthernet0/0
 description "To R3"
 ip address 10.1.34.4 255.255.255.0

interface FastEthernet1/0
 description "To R5"
 ip address 10.1.45.4 255.255.255.0

router bgp 200
 bgp log-neighbor-changes
 neighbor 10.1.34.3 remote-as 200
 neighbor 10.1.45.5 remote-as 300


R5:


hostname R5

interface FastEthernet1/0
 description "To R4"
 ip address 10.1.45.5 255.255.255.0

router bgp 300
 bgp log-neighbor-changes
 neighbor 10.1.45.4 remote-as 200


R5 - Verify:


R5#sho ip bgp
BGP table version is 13, local router ID is 10.1.45.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  100.1.1.1/32     10.1.45.4                              0 200 200 200 i
R5#