How to configure BGP peer-session template

Here is "How to configure BGP peer-session template"

[ Assignement ]

All 4 routers are in AS 100 and linked in same Ethernet segment.
Establish BGP sessions, using Loopback 0 interface. Use RIPv2 as IGP.
Use template name "common" and "ibgp" and follow below guides;

common – verizon 4
                password showipbgp

ibgp –       remote-as 100
                update-source loopback 0

[ IP Address Table ]

R1 – FastEthernet0/0 : 192.168.1.1/24
                 Loopback0 : 1.1.1.1/8
                 Loopback1 : 10.10.10.0/24

R2 – FastEthernet0/0 : 192.168.1.2/24
                 Loopback0 : 2.2.2.2/8
                 Loopback1 : 20.20.20.0/24

R3 – FastEthernet0/0 : 192.168.1.3/24
                 Loopback0 : 3.3.3.3/8
                 Loopback1 : 30.30.30.0/24

R4 – FastEthernet0/0 : 192.168.1.4/24
                 Loopback0 : 4.4.4.4/8
                 Loopback1 : 40.40.40.0/24

 

[ Network Outline ]

 Picture of bgp-peer-session

[ R1 ]

router rip
 version 2
 network 1.0.0.0
 network 192.168.1.0
!
router bgp 100
 template peer-session common
  password showipbgp
  version 4
 exit-peer-session
 !
 template peer-session ibgp
  remote-as 100
  update-source Loopback0
  inherit peer-session common
 exit-peer-session
 !
 no synchronization
 bgp log-neighbor-changes
 network 10.10.10.0 mask 255.255.255.0
 neighbor 2.2.2.2 inherit peer-session ibgp
 neighbor 3.3.3.3 inherit peer-session ibgp
 neighbor 4.4.4.4 inherit peer-session ibgp
no auto-summary

 

[ R2 ]

router rip
 version 2
 network 2.0.0.0
 network 192.168.1.0
!
router bgp 100
 template peer-session common
  password showipbgp
  version 4
 exit-peer-session
 !
 template peer-session ibgp
  remote-as 100
  update-source Loopback0
  inherit peer-session common
 exit-peer-session
 !
 no synchronization
 bgp log-neighbor-changes
 network 20.20.20.0 mask 255.255.255.0
 neighbor 1.1.1.1 inherit peer-session ibgp
 neighbor 3.3.3.3 inherit peer-session ibgp
 neighbor 4.4.4.4 inherit peer-session ibgp
no auto-summary

 

[ R3 ]

router rip
 version 2
 network 3.0.0.0
 network 192.168.1.0
!
router bgp 100
 template peer-session common
  password showipbgp
  version 4
 exit-peer-session
 !
 template peer-session ibgp
  remote-as 100
  update-source Loopback0
  inherit peer-session common
 exit-peer-session
 !
 no synchronization
 bgp log-neighbor-changes
 network 30.30.30.0 mask 255.255.255.0
 neighbor 1.1.1.1 inherit peer-session ibgp
 neighbor 2.2.2.2 inherit peer-session ibgp
 neighbor 4.4.4.4 inherit peer-session ibgp
no auto-summary

 

[ R4 ]

router rip
 version 2
 network 4.0.0.0
 network 192.168.1.0
!
router bgp 100
 template peer-session common
  password showipbgp
  version 4
 exit-peer-session
 !
 template peer-session ibgp
  remote-as 100
  update-source Loopback0
  inherit peer-session common
 exit-peer-session
 !
 no synchronization
 bgp log-neighbor-changes
 network 40.40.40.0 mask 255.255.255.0
 neighbor 1.1.1.1 inherit peer-session ibgp
 neighbor 2.2.2.2 inherit peer-session ibgp
 neighbor 3.3.3.3 inherit peer-session ibgp
no auto-summary

 

[Verifying]

R1#sh ip bgp template peer-session ibgp
Template:ibgp, index:2
Local policies:0x81, Inherited polices:0x2
This template inherits:
  common index:1 flags:0x0
Locally configured session commands:
 remote-as 100
 update-source Loopback0
Inherited session commands:
 version 4

R1#sh ip bgp
BGP table version is 15, local router ID is 10.10.10.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
*> 10.10.10.0/24    0.0.0.0                  0         32768 i
*>i20.20.20.0/24    2.2.2.2                  0    100      0 i
*>i30.30.30.0/24    3.3.3.3                  0    100      0 i
*>i40.40.40.0/24    4.4.4.4                  0    100      0 i
 

R2#sh ip bgp template peer-session ibgp
Template:ibgp, index:2
Local policies:0x81, Inherited polices:0x2
This template inherits:
  common index:1 flags:0x0
Locally configured session commands:
 remote-as 100
 update-source Loopback0
Inherited session commands:
 version 4

R2#sh ip bgp
BGP table version is 20, local router ID is 20.20.20.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
*>i10.10.10.0/24    1.1.1.1                  0    100      0 i
*> 20.20.20.0/24    0.0.0.0                  0         32768 i
*>i30.30.30.0/24    3.3.3.3                  0    100      0 i
*>i40.40.40.0/24    4.4.4.4                  0    100      0 i

 

R3#sh ip bgp template peer-session ibgp
Template:ibgp, index:2
Local policies:0x81, Inherited polices:0x2
This template inherits:
  common index:1 flags:0x0
Locally configured session commands:
 remote-as 100
 update-source Loopback0
Inherited session commands:
 version 4

R3#sh ip bgp
BGP table version is 7, local router ID is 30.30.30.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
*>i10.10.10.0/24    1.1.1.1                  0    100      0 i
*>i20.20.20.0/24    2.2.2.2                  0    100      0 i
*> 30.30.30.0/24    0.0.0.0                  0         32768 i
*>i40.40.40.0/24    4.4.4.4                  0    100      0 i

 

R4#sh ip bgp template peer-session ibgp
Template:ibgp, index:2
Local policies:0x81, Inherited polices:0x2
This template inherits:
  common index:1 flags:0x0
Locally configured session commands:
 remote-as 100
 update-source Loopback0
Inherited session commands:
 version 4

R4#sh ip bgp
BGP table version is 5, local router ID is 40.40.40.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
*>i10.10.10.0/24    1.1.1.1                  0    100      0 i
*>i20.20.20.0/24    2.2.2.2                  0    100      0 i
*>i30.30.30.0/24    3.3.3.3                  0    100      0 i
*> 40.40.40.0/24    0.0.0.0                  0         32768 i

 

Author: Chris Yoon

IT professional