Friday, December 25, 2015

BGP task #1. Basic BGP.

Topology:




Routers R3 and R4 are IOS-XR, remaining routers are IOS routers.

For initial setup, configure loopback0 interfaces on all routers, and links between the routers:
  R7-R8: 8.0.78.X/24
  R6-R8: 8.0.68.X/24
  R5-R8: 8.0.58.X/24
  R3-R6: 67.0.36.X/24
  R3-R7: 67.0.37.X/24
  R1-R5: 5.0.15.X/24
  VLAN-10: 12.0.10.X/24
  VLAN-20: 12.0.20.X/24

Requirements: 

1. Configure iBGP peerings between routers in AS 12. 
2. Configure iBGP peerings between routers in AS 67.
3. Configure eBGP peerings between autonomous systems in the topology. 
4. Each autonomous system should advertise it's assigned IPv4 network into BGP. 
5. On R8, don't use "network" command under BGP configuration. 
6. In autonomous-system 12, routers R2 and R4 should advertise the prefix 12.0/16 the BGP. 

Solution:

Highlight the text below to reveal the solution.

This is a basic iBGP and eBGP setup, which will use a as base for the next group of tasks. 
Note that IOS-XR requires an explicit in and out route-policy for eBGP peerings. 
In AS12, eBGP next-hop need to be reachable for routers R2 and R4. This can be achieved by either advertising external interfaces into IGP, or using next-hop-self on iBGP peerings. The recommended method, for the fast convergence, is to advertise eBGP next-hop into IGP. External interfaces are configured as passive in OSPF. Same solution shall be implemented in AS67. 
Requirement #5 - since using network command is not allowed, use redistribution of static route into BGP. 

R1:


!
interface Ethernet0/0
 ip address 12.0.20.1 255.255.255.0
 ip ospf 1 area 0
!
interface Ethernet1/0
 ip address 5.0.15.1 255.255.255.0
 ip ospf 1 area 0
!
router bgp 12
 bgp log-neighbor-changes
 neighbor 5.0.15.5 remote-as 5
 neighbor 12.0.2.2 remote-as 12
 neighbor 12.0.2.2 update-source Loopback0
 neighbor 12.0.3.3 remote-as 12
 neighbor 12.0.3.3 update-source Loopback0
 neighbor 12.0.4.4 remote-as 12
 neighbor 12.0.4.4 update-source Loopback0
!
router ospf 1
 router-id 12.0.1.1
 passive-interface Ethernet1/0
!

R2:

!
router bgp 12
 bgp log-neighbor-changes
 network 12.0.0.0 mask 255.255.0.0
 neighbor 12.0.1.1 remote-as 12
 neighbor 12.0.1.1 update-source Loopback0
 neighbor 12.0.3.3 remote-as 12
 neighbor 12.0.3.3 update-source Loopback0
 neighbor 12.0.4.4 remote-as 12
 neighbor 12.0.4.4 update-source Loopback0
!

R3:


!
router ospf CCIE
 router-id 12.0.3.3
 area 0
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   passive enable
  !
  interface GigabitEthernet0/0/0/1
   passive enable
  !
  interface GigabitEthernet0/0/0/2
  !
 !
!
router bgp 12
 address-family ipv4 unicast
 !
 neighbor 12.0.1.1
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor 12.0.2.2
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor 12.0.4.4
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor 67.0.36.6
  remote-as 67
  address-family ipv4 unicast
   route-policy BGP_ALL in
   route-policy BGP_ALL out
  !
 !
 neighbor 67.0.37.7
  remote-as 67
  address-family ipv4 unicast
   route-policy BGP_ALL in
   route-policy BGP_ALL out
  !
 !
!
route-policy BGP_ALL
  pass
end-policy
!


R4:

!
router bgp 12
 address-family ipv4 unicast
  network 12.0.0.0/16
 !
 neighbor 12.0.1.1
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor 12.0.2.2
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
 neighbor 12.0.3.3
  remote-as 12
  update-source Loopback0
  address-family ipv4 unicast
  !
 !
!

R5:


!
router bgp 5
 bgp log-neighbor-changes
 network 5.0.0.0 mask 255.255.0.0
 neighbor 5.0.15.1 remote-as 12
 neighbor 8.0.58.8 remote-as 8
!

R6:


!
interface Ethernet0/0
 ip address 67.0.67.6 255.255.255.0
 ip router isis CCIE
!
interface Ethernet1/0
 ip address 67.0.36.6 255.255.255.0
!
interface Ethernet1/1
 ip address 8.0.68.6 255.255.255.0
!
router isis CCIE
 net 49.0067.0000.0000.0006.00
 passive-interface Ethernet1/0
 passive-interface Ethernet1/1
!
router bgp 67
 bgp log-neighbor-changes
 network 67.0.0.0 mask 255.255.0.0
 neighbor 8.0.68.8 remote-as 8
 neighbor 67.0.36.3 remote-as 12
 neighbor 67.0.67.7 remote-as 67
!

R7:



!
interface Ethernet0/0
 ip address 67.0.67.7 255.255.255.0
 ip router isis CCIE
!
interface Ethernet1/0
 ip address 67.0.37.7 255.255.255.0
!
interface Ethernet1/1
 ip address 8.0.78.7 255.255.255.0
!
router isis CCIE
 net 49.0067.0000.0000.0007.00
 passive-interface Ethernet1/0
 passive-interface Ethernet1/1
!
router bgp 67
 bgp log-neighbor-changes
 network 67.0.0.0 mask 255.255.0.0
 neighbor 8.0.78.8 remote-as 8
 neighbor 67.0.37.3 remote-as 12
 neighbor 67.0.67.6 remote-as 67
!

R8:


!
router bgp 8
 bgp log-neighbor-changes
 redistribute static route-map STATIC
 neighbor 8.0.58.5 remote-as 5
 neighbor 8.0.68.6 remote-as 67
 neighbor 8.0.78.7 remote-as 67
!

Verification:

R8#show bgp
BGP table version is 7, local router ID is 8.0.8.8
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
 *>  5.0.0.0/16       8.0.58.5                 0             0 5 i
 *>  8.0.0.0/16       0.0.0.0                  0         32768 ?
 *   12.0.0.0/16      8.0.78.7                               0 67 12 i
 *                    8.0.68.6                               0 67 12 i
 *>                   8.0.58.5                               0 5 12 i
 *   67.0.0.0/16      8.0.68.6                 0             0 67 i
 *>                   8.0.78.7                 0             0 67 i



RP/0/0/CPU0:R4#show bgp
Sun Dec 20 22:19:03.957 UTC
BGP router identifier 12.0.4.4, local AS number 12
BGP generic scan interval 60 secs
BGP table state: Active
Table ID: 0xe0000000   RD version: 9
BGP main routing table version 9
BGP scan interval 60 secs

Status codes: s suppressed, d damped, h history, * valid, > best
              i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network            Next Hop            Metric LocPrf Weight Path
*>i5.0.0.0/16         5.0.15.5                 0    100      0 5 i
*>i8.0.0.0/16         5.0.15.5                 0    100      0 5 8 ?
* i                   67.0.36.6                     100      0 67 8 ?
*> 12.0.0.0/16        0.0.0.0                  0         32768 i
* i                   12.0.2.2                 0    100      0 i
*>i67.0.0.0/16        67.0.36.6                0    100      0 67 i

Processed 4 prefixes, 6 paths

R2#show bgp
BGP table version is 9, local router ID is 12.0.2.2
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 5.0.0.0/16       5.0.15.5                 0    100      0 5 i
 * i 8.0.0.0/16       67.0.36.6                     100      0 67 8 ?
 *>i                  5.0.15.5                 0    100      0 5 8 ?
 * i 12.0.0.0/16      12.0.4.4                 0    100      0 i
 *>                   0.0.0.0                  0         32768 i
 *>i 67.0.0.0/16      67.0.36.6                0    100      0 67 i

1 comment:

  1. Hi Dimitry Raitses, I'm really enjoying the LABs. I am trying to do the same as you, but something is wrong with my lab. Could you please send me the whole config to be compare with mine? Thanks! Diego (diego.farani@outlook.com)

    ReplyDelete