Thursday 30 April 2020

BGP CHAPTER 8 -Reading BGP Table


Let's first check BGP status of all routers


R1#sh ip bgp summary
BGP router identifier 14.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2           4   200       7            7                1    0    0               00:04:22               0
13.1.1.3           4   300       5            5                1    0    0               00:01:18        0
14.1.1.4           4   100       4            4                1    0    0                00:00:02        0

R2#sh ip bgp sum
BGP router identifier 23.1.1.2, local AS number 200
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/Pfx 

Rcd
12.1.1.1        4   100       9       9        1    0    0 00:06:29        0

23.1.1.3        4   300       7       8        1    0    0 00:04:43        0

R3#sh ip bgp summary
BGP router identifier 23.1.1.3, local AS number 300
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

13.1.1.1            4   100       8               8               1           0    0            00:04:12        0
23.1.1.2            4   200       9               8               1           0    0            00:05:29        0

R4#sh ip bgp summary
BGP router identifier 14.1.1.4, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

14.1.1.1            4   100             7       7                   1         0    0              00:03:48        0




BGP Router ID :- 

a.k.a BGP Identifier is the highest loopback IP address configured on the router and in absence of the loopback interface BGP Router ID will be the highest IP address configured to an active physical interface.

Routes are indicated by various symbols -

" >  "   greater than sign means best route.
" * "    valid router
" i "     the route learned from  same AS i.e. IBGP route.

We can also view multiple BGP attributes in the bgp table .
- Origin Code
- AS PATH
-Next Hop
-Weight
-Local Preference


Origin Code-

i - IGP - it means the network is advertise in BGP using "network" command.
? -Unknow - it means the network is redistributed into BGP from IGP or static.
e- EGP - it means the network is learned via EGP which is a legacy protocol so we never see it in output.

Status Code -

r - RIB failure
Routing Information Base Failure - It occurs when BGP knows about the network but it is not getting installed in its Routing table since there is some other Routing protocol with less AD.

d- Damped
Incase any network is flapping continuously then the status of the route will be damped.

s-Suppressed
BGP knows about the network but that network is part of summarization

S- stale
The route is stale and need to refreshed when bgp peer is re-established . it is used with
nonstop forwarding.

DIAGRAM 1 - BGP TABLE 


DIAGRAM 2 - Redistributed Routes in BGP

DIAGRAM 3 - RIB Failure 

R1#sh run
Building configuration...

Current configuration : 1342 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0
 ip address 14.1.1.1 255.255.255.0
 speed auto
!
interface Serial0
 ip address 12.1.1.1 255.255.255.0
!
interface Serial1
 no ip address
 shutdown
!
interface Serial2
 ip address 13.1.1.1 255.255.255.0
!
router eigrp 200
 network 14.0.0.0
 auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.1 mask 255.255.255.255
 redistribute eigrp 200
 neighbor 12.1.1.2 remote-as 200
 neighbor 13.1.1.3 remote-as 300
 neighbor 14.1.1.4 remote-as 100
 no auto-summary
!
ip forward-protocol nd
ip route 100.100.100.0 255.255.255.0 14.1.1.4
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end
========================================================
R2#sh run
Building configuration...

Current configuration : 1178 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0
 no ip address
 shutdown
 speed auto
!
interface Serial0
 ip address 12.1.1.2 255.255.255.0
!
interface Serial1
 ip address 23.1.1.2 255.255.255.0
!
interface Serial2
 no ip address
 shutdown
!
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 network 2.2.2.2 mask 255.255.255.255
 neighbor 12.1.1.1 remote-as 100
 neighbor 23.1.1.3 remote-as 300
 no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end
=============================================================

R3#sh run
Building configuration...

Current configuration : 972 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0
 no ip address
 shutdown
 speed auto
!
interface Serial0
 no ip address
 shutdown
 no fair-queue
!
interface Serial1
 ip address 23.1.1.3 255.255.255.0
!
interface Serial2
 ip address 13.1.1.3 255.255.255.0
!
router bgp 300
 no synchronization
 bgp log-neighbor-changes
 network 3.3.3.3 mask 255.255.255.255
 neighbor 13.1.1.1 remote-as 100
 neighbor 23.1.1.2 remote-as 200
 no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
line aux 0
line vty 0 4
 login
!
end
=========================================================

R4#sh run
Building configuration...

Current configuration : 1365 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
!
interface Loopback1
 ip address 100.100.100.1 255.255.255.0
!
interface Loopback200
 ip address 200.0.0.1 255.0.0.0
!
interface FastEthernet0
 ip address 14.1.1.4 255.255.255.0
 speed auto
!
interface Serial0
 no ip address
 shutdown
!
interface Serial1
 no ip address
 shutdown
!
interface Serial2
 no ip address
 shutdown
!
router eigrp 200
 network 14.0.0.0
 network 200.0.0.0
 auto-summary
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 4.4.4.4 mask 255.255.255.255
 network 100.100.100.0 mask 255.255.255.0
 neighbor 14.1.1.1 remote-as 100
 no auto-summary
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
end

Hope you all like this post !!!!
Thanks for reading!!!

Wednesday 29 April 2020

BGP CHAPTER 7 - SHUTTING BGP NEIGHBOR


R1#sh run int s0
Building configuration...

Current configuration : 60 bytes
!
interface Serial0
 ip address 12.1.1.1 255.255.255.0
end

R2#sh run int s0
Building configuration...

Current configuration : 60 bytes
!
interface Serial0
 ip address 12.1.1.2 255.255.255.0
end


R1#sh run | section bgp
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 12.1.1.2 remote-as 200
 no auto-summary


R2#sh run | section bgp
router bgp 200
 no synchronization
 bgp log-neighbor-changes
 neighbor 12.1.1.1 remote-as 100
 no auto-summary

R1(config)#router bgp 100

R1(config-router)#neighbor 12.1.1.2 shutdown

R1(config-router)#^Z
R1#
*Mar  1 00:05:05.175: BGPNSF state: 12.1.1.2 went from nsf_not_active to nsf_not_active
*Mar  1 00:05:05.175: BGP: 12.1.1.2 went from Established to Idle
*Mar  1 00:05:05.175: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Down Admin. shutdown
*Mar  1 00:05:05.175: BGP: 12.1.1.2 closing
R1#
*Mar  1 00:05:05.247: %SYS-5-CONFIG_I: Configured from console by console
R1#

R1#sh ip bgp sum
BGP router identifier 12.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.2            4   200       2             2        0    0    0                               00:01:22     Idle (Admin)

R2#sh ip bgp sum
BGP router identifier 12.1.1.2, local AS number 200
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.1            4   100       2              2                0           0    0            00:02:31   Active

R1(config)#
R1(config)#router bgp 100

R1(config-router)#no neighbor 12.1.1.2 shutdown

R1(config-router)#
*Mar  1 00:09:13.447: BGP: 12.1.1.2 went from Idle to Active
*Mar  1 00:09:13.455: BGP: 12.1.1.2 open active, local address 12.1.1.1
*Mar  1 00:09:13.483: BGP: 12.1.1.2 went from Active to OpenSent
*Mar  1 00:09:13.483: BGP: 12.1.1.2 sending OPEN, version 4, my as: 100, holdtime 180 seconds
*Mar  1 00:09:13.487: BGP: 12.1.1.2 send message type 1, length (incl. header) 45
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcv message type 1, length (excl. header) 26
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcv OPEN, version 4, holdtime 180 seconds
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcv OPEN w/ OPTION parameter len: 16
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 6
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has CAPABILITY code: 1, length 4
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has MP_EXT CAP for afi/safi: 1/1
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has CAPABILITY code: 128, length 0
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has ROUTE-REFRESH capability(old) for all address-families
*Mar  1 00:09:13.503: BGP: 12.1.1.2 rcvd OPEN w/ optional parameter type 2 (Capability) len 2
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has CAPABILITY code: 2, length 0
*Mar  1 00:09:13.503: BGP: 12.1.1.2 OPEN has ROUTE-REFRESH capability(new) for all address-families
BGP: 12.1.1.2 rcvd OPEN w/ remote AS 200
*Mar  1 00:09:13.503: BGP: 12.1.1.2 went from OpenSent to OpenConfirm
*Mar  1 00:09:13.503: BGP: 12.1.1.2 went from OpenConfirm to Established
*Mar  1 00:09:13.503: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Up
R1(config-router)#
R1(config-router)#^Z
R1#
*Mar  1 00:09:17.011: %SYS-5-CONFIG_I: Configured from console by console
R1#sh ip bgp sum
BGP router identifier 12.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.1.1.2            4   200       6                6        1             0  0               00:00:08        0


Thanks for reading !!!!










Tuesday 28 April 2020

Switching Tshoot - Ticket 1


PC AND LAPTOP BOTH ARE IN THE SAME VLAN 10 (10.1.1.0/24)

WHEREAS SERVER IS IN THE ANOTHER VLAN 20 (10.1.2.0/24)

SW1 is a Layer 3 Switch

SW2 , SW3 AND SW4 are Layer 2 Switches

Issue :-
=================

PC not able to ping laptop and vice versa









SW2#sh int status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        connected    1          auto    auto  10/100BaseTX
Fa0/2                        connected    1          auto    auto  10/100BaseTX

From PC

FastEthernet0 Connection:(default port)

   Link-local IPv6 Address.........: FE80::201:64FF:FE0C:9609
   IP Address......................: 10.1.1.2
   Subnet Mask.....................: 255.255.255.0
   Default Gateway.................: 10.1.1.1
 
 
Let try to ping the laptop

C:\>ping 10.1.1.3

Pinging 10.1.1.3 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.1.1.3:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

interface FastEthernet0/2
 switchport access vlan 10
 switchport mode access

SW2#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24, Gig0/1, Gig0/2
1002 fddi-default                     active 
1003 token-ring-default               active 
1004 fddinet-default                  active 
1005 trnet-default                    active 
SW2#

NO L2 VLAN 10 IS CREATED

LETS CREATE VLAN 10

SW2#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
SW2(config)#vlan 10
SW2(config-vlan)#^Z
SW2#
%SYS-5-CONFIG_I: Configured from console by console

SW2#
SW2#sh vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24, Gig0/1, Gig0/2
10   VLAN0010                         active    Fa0/2
1002 fddi-default                     active 
1003 token-ring-default               active 
1004 fddinet-default                  active 
1005 trnet-default                    active 
SW2#


But still not able to ping Laptop

C:\>ping 10.1.1.3

Pinging 10.1.1.3 with 32 bytes of data:

Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.1.1.3:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),


Lets check on switch 4

SW4#sh int status
Port      Name               Status       Vlan       Duplex  Speed Type
Fa0/1                        err-disabled 1          auto    auto  10/100BaseTX
Fa0/2                        connected    10         auto    auto  10/100BaseTX

We can see the trunk interface Fa0/1 is in err-disabled

SW4(config)#int fa0/1
SW4(config-if)#sh

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
SW4(config-if)#no sh

SW4(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%SPANTREE-2-BLOCK_BPDUGUARD: Received BPDU on port FastEthernet0/1 with BPDU Guard enabled. Disabling port.

%PM-4-ERR_DISABLE: bpduguard error detected on 0/1, putting 0/1 in err-disable state


%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

On interface Fa0/1 which is a trunk port BPDU guard is enable which makes it disabled

SW4#sh spanning-tree interface fa0/1
no spanning tree info available for FastEthernet0/1

interface FastEthernet0/1
 switchport mode trunk
 spanning-tree bpduguard enable

SW4(config)#int fa0/1
SW4(config-if)#spanning-tree bpduguard ?
  disable  Disable BPDU guard for this interface
  enable   Enable BPDU guard for this interface
SW4(config-if)#spanning-tree bpduguard disable
SW4(config-if)#^Z
SW4#

SW4(config)#int fa0/1
SW4(config-if)#shut

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
SW4(config-if)#no shut

SW4(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

SW4(config-if)#^Z
SW4#
%SYS-5-CONFIG_I: Configured from console by console

SW4#sh spanning-tree interface fa0/1
Vlan             Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
VLAN0001         Altn LSN 19        128.1     P2p
VLAN0010         Altn LSN 19        128.1     P2p

NOW LETS PING PC TO Laptop
C:\>ping 10.1.1.3

Pinging 10.1.1.3 with 32 bytes of data:

Reply from 10.1.1.3: bytes=32 time=11ms TTL=128
Reply from 10.1.1.3: bytes=32 time<1ms TTL=128
Reply from 10.1.1.3: bytes=32 time=1ms TTL=128
Reply from 10.1.1.3: bytes=32 time<1ms TTL=128

Ping statistics for 10.1.1.3:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 11ms, Average = 3ms


Thanks For Reading !!!!

Monday 27 April 2020

BGP CHAPTER 6 - IBGP Neighborship using loopback interfaces

In this chapter we are going to see IBGP Neighborship between  non-connected routers i.e. using Loopback interfaces.

Here R1 , R2 , R3 and R4 belongs to AS 100 i.e same AS .

IBGP




We need to configure BGP on R1 & R4 which are non-connected routers.


This will be IBGP since R1 & R4 both belongs to same AS .


We will be using loopback interfaces IP address as BGP peer IP address.


We would need an IGP to provide connectivity between loopback interfaces of R1 and R4.


ie. we should able to ping R4's loopback 4.4.4.4 from R1 keeping source R1's loopback 1.1.1.1 & vice versa.


So lets configure EIGRP on all routers i.e R1 , R2 , R3 & R4.


Note :- We are not using physical interfaces IP address because if the link goes down the bgp peering will go although it have alternate path . Loopback interfaces are logical interfaces and they never go down even if the physical interfaces goes since they would have reachability from the alternate link.


LETS CHECK THE IP ADDRESSES AND STATUS FOR THE INTERFACES ON ALL ROUTERS


R1#sh int des
Interface                      Status         Protocol Description
Fa0                            admin down     down
Se0                            up             up       TO R2
Se1                            up             up       TO R3
Se2                            admin down     down

R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0              unassigned      YES unset  administratively down down
Serial0                    12.1.1.1        YES manual up                    up
Serial1                    13.1.1.1        YES manual up                    up
Serial2                    unassigned      YES unset  administratively down down

R2#sh int des
Interface                      Status         Protocol Description

Fa0                            admin down     down
Se0                            up             up       TO R1
Se1                            up             up       TO R4
Se2                            admin down     down

R2#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0              unassigned      YES unset  administratively down down
Serial0                    12.1.1.2        YES manual up                    up
Serial1                    24.1.1.2        YES manual up                    up
Serial2                    unassigned      YES unset  administratively down down

R3#sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Se0                            up             up       TO R4

Se1                            up             up       TO R1
Se2                            admin down     down



R3#sh ip int brief



Interface                  IP-Address      OK? Method Status                Protocol



FastEthernet0              unassigned      YES unset  administratively down down



Serial0                    34.1.1.3        YES manual up                    up



Serial1                    13.1.1.3        YES manual up                    up





Serial2                    unassigned      YES unset  administratively down down



R4#sh int des



Interface                      Status         Protocol Description



Fa0                            admin down     down



Se0                            up             up       TO R3



Se1                            up             up       to R2



Se2                            admin down     down



R4#sh ip int brief



Interface                  IP-Address      OK? Method Status                Protocol



FastEthernet0              unassigned      YES unset  administratively down down



Serial0                    34.1.1.4        YES manual up                    up



Serial1                    24.1.1.4        YES manual up                    up



Serial2                    unassigned      YES unset  administratively down down





CONFIGURATION OF EIGRP ALL THE ROUTERS



R1(config)#router eigrp 10



R1(config-router)#network 12.1.1.0 255.255.255.0



R1(config-router)#network 13.1.1.0 255.255.255.0



R1(config-router)#network 1.1.1.1 255.255.255.255



R1(config-router)#^Z







R2(config)#router eigrp 10



R2(config-router)#network 12.1.1.0 255.255.255.0



R2(config-router)#network 24.1.1.0 255.255.255.0



R2(config-router)#network 2.2.2.2 255.255.255.255



R2(config-router)#^Z







R3(config)#router eigrp 10



R3(config-router)#network 13.1.1.0 255.255.255.0



R3(config-router)#network 34.1.1.0 255.255.255.0



R3(config-router)#network 3.3.3.3 255.255.255.255



R3(config-router)#^Z







R4(config)#router eigrp 10



R4(config-router)#network 24.1.1.0 255.255.255.0



R4(config-router)#network 34.1.1.0 255.255.255.0



R4(config-router)#network 4.4.4.4 255.255.255.255



R4(config-router)#^Z



!! Testing Loopback to Loopback Reachability for R1 & R4



R1#ping 4.4.4.4 source loopback 0

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:

Packet sent with a source address of 1.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/52/64 ms



R4#ping 1.1.1.1 source loopback 0



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:

Packet sent with a source address of 4.4.4.4

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/41/56 ms

Lets Configure IBGP between R1 and R4 using loopback interfaces.

R1(config)#router bgp 100

R1(config-router)#neighbor 4.4.4.4 remote-as 100

R1(config-router)#neighbor 4.4.4.4 update-source loopback 0

R1(config-router)#^Z

!

R4(config)#router bgp 100

R4(config-router)#neighbor 1.1.1.1 remote-as 100

R4(config-router)#neighbor 1.1.1.1 update-source loopback 0

R4(config-router)#^Z

Log on R1

Dec 20 01:19:13.015: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up

R1#sh ip bgp summary

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

      4.4.4.4         4   100       5       5                   1          0    0             00:01:24        0



R4#sh ip bgp summary

BGP router identifier 4.4.4.4, local AS number 100

BGP table version is 1, main routing table version 1



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

    1.1.1.1         4   100       5           5                     1    0    0            00:01:45        0

Points to Remember

•We can configure iBGP Neighborship between Non-connected routers.

•The Peer IP’s should have reachability between each others.

The Loopback interfaces are more preferred since they don’t go down even if an link goes down .The reachability between loopback interfaces can be achieved via alternate path

Sunday 26 April 2020

BGP CHAPTER 5- UNDERSTANDING NETWORK ADVERTISEMENT IN BGP

IN BGP we need to manually advertised network/s.
Methods by which we can advertise Network/s in BGP -

>Using Network Command
>Redistribution


1) Using Network Command.


In IGP like OSPF , EIGRP we have seen that once we use network command then all the interfaces falling in the range of network command will get active in IGP.
But in BGP that is not the case .
BGP refers the Routing table (not the interfaces) to install the route in its BGP table.


Network Advertisement in BGP



R1#sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Lo0                            up             up

Se0                            up             up

Se1                            admin down     down

Se2                            admin down     down sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Lo0                            up             up

Se0                            up             up

Se1                            admin down     down

Se2                            admin down     down

R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              unassigned      YES NVRAM  administratively down down

Loopback0                  1.1.1.1         YES NVRAM  up                    up

Serial0                    12.1.1.1        YES NVRAM  up                    up

Serial1                    unassigned      YES NVRAM  administratively down down

Serial2                    unassigned      YES NVRAM  administratively down down

R1#sh ip bgp sum

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2           4   200       3       3                     1            0    0             00:00:34        0

R1#

R1#sh ip bgp



R1#


R2#sh int des

Interface                      Status         Protocol Description

Fa0                            admin down     down

Se0                            admin down     down

Se1                            up             up

Se2                            admin down     down

R2#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              unassigned      YES NVRAM  administratively down down

Serial0                    unassigned      YES NVRAM  administratively down down

Serial1                    12.1.1.2        YES NVRAM  up                    up

Serial2                    unassigned      YES NVRAM  administratively down down

R2#

R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 1, main routing table version 1


Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1          4     100       6       6                      1         0    0             00:03:45        0


R2#

!!! Creating a loopback interface on R1
R1(config)#int loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config-if)#^Z


R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route



Gateway of last resort is not set



     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0

R1#



R1(config)#router bgp 100

R1(config-router)#network 1.1.1.0 mask 255.255.255.0



R1#sh ip bgp   <----------------------- Nothing in BGP table .



R2#sh ip bgp <---------------------------Nothing in BGP table



R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 3, main routing table version 3



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1               4   100      25      23                  3            0    0         00:20:43        0

R2#

No prefixes received from R1



Lets configure exact network



R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#no network 1.1.1.0 mask 255.255.255.0

R1(config-router)#network 1.1.1.1 mask 255.255.255.255

R1(config-router)#^Z



R1#sh ip bgp

BGP table version is 4, 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

*> 1.1.1.1/32           0.0.0.0                  0         32768 i

R1#



R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 4, main routing table version 4

1 network entries using 117 bytes of memory

1 path entries using 52 bytes of memory

2/1 BGP path/bestpath attribute entries using 248 bytes of memory

1 BGP AS-PATH entries using 24 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 441 total bytes of memory

BGP activity 2/1 prefixes, 2/1 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.1        4        100      33      30                 4          0    0             00:27:13        1

R2#

R2#sh ip bgp

BGP table version is 4, local router ID is 2.2.2.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



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0       100      i



Lets prove -" BGP refers the Routing table (not the interfaces) to install the route in its BGP table."

UNDERSTANDING NETWORK ADVERTISEMENT IN BGP


R3#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              13.1.1.3        YES  manual up                    up

Loopback3                  3.3.3.3         YES   manual up                    up





R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              13.1.1.1        YES manual up                    up

Loopback0                  1.1.1.1         YES NVRAM  up                    up

Serial0                       12.1.1.1         YES NVRAM  up                    up





R1(config)#ip route 3.3.3.3 255.255.255.255 13.1.1.3

R1(config)#^Z

R1#p

Dec 13 01:44:30.495: %SYS-5-CONFIG_I: Configured from console by console

R1#ping 3.3.3.3



Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route



Gateway of last resort is not set



     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     3.0.0.0/32 is subnetted, 1 subnets

S       3.3.3.3 [1/0] via 13.1.1.3

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial0

     13.0.0.0/24 is subnetted, 1 subnets

C       13.1.1.0 is directly connected, FastEthernet0

R1#



3.3.3.3/32 is not an interface of R1 but it a route in routing table of R1.



Let's us advertise the same in BGP and check whether its gets installed in BGP table -



R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#network 3.3.3.3 mask 255.255.255.255

R1(config-router)#^Z

R1#

R1#sh i

Dec 13 01:47:27.687: %SYS-5-CONFIG_I: Configured from console by console

R1#sh ip bgp

BGP table version is 5, 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

*> 1.1.1.1/32       0.0.0.0                  0         32768 i

*> 3.3.3.3/32       13.1.1.3                 0         32768 i

R1#



R2#sh ip bg

BGP table version is 5, local router ID is 2.2.2.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



   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0       100      i

*> 3.3.3.3/32       12.1.1.1                 0             0       100      i

R2#



It's getting successfully installed in BGP TABLE.

==============================================================

2) Redistribution


•The routes from other Routing Protocols can be redistributed into BGP.

•Using redistribution command .

•These routers are represented by origin code – “?”



R1(config)#int loopback 100

R1(config-if)#ip add 100.100.100.1 255.255.255.0



R1(config)#router eigrp 10

R1(config-router)#network 100.100.100.0 255.255.255.0

R1(config-router)#^Z

R1#

Dec 13 02:02:35.235: %SYS-5-CONFIG_I: Configured from console by console

R1#config

Configuring from terminal, memory, or network [terminal]?

Enter configuration commands, one per line.  End with CNTL/Z.

R1(config)#router bgp 100

R1(config-router)#red

R1(config-router)#redistribute ei

R1(config-router)#redistribute eigrp ?

  <1-65535>  Autonomous system number



R1(config-router)#redistribute eigrp 10

R1(config-router)#^Z

R1#

Dec 13 02:02:53.767: %SYS-5-CONFIG_I: Configured from console by console

R1#



R1#sh ip bgp

BGP table version is 6, 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

*> 1.1.1.1/32       0.0.0.0                  0         32768 i

*> 3.3.3.3/32       13.1.1.3                 0         32768 i

*> 100.100.100.0/24 0.0.0.0                  0         32768 ?


R2#sh ip bgp

BGP table version is 6, local router ID is 2.2.2.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


   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       12.1.1.1                 0             0 100 i

*> 3.3.3.3/32       12.1.1.1                 0             0 100 i

*> 100.100.100.0/24 12.1.1.1                 0             0 100 ?


Thanks for Reading !!!!

Saturday 25 April 2020

BGP CHAPTER 4 - BGP CONFIGURATION USING LOOPBACK INTERFACES

!!Verifying Current Interface Configuration on R1 & R2

R1#sh int des

Interface                      Status         Protocol Description

Lo0                              up             up

Se0                               up             up       WAN CONNECTION 1

Se1                                up             up       WAN CONNECTION 2

R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

Loopback0             1.1.1.1                   YES manual    up                    up

Serial0                    12.1.1.1                  YES NVRAM  up                    up

Serial1                    21.1.1.1                   YES manual    up                    up


===========================================================

R2#sh int des

Interface                      Status         Protocol Description

Lo0                            up             up

Se0                            up             up       WAN CONNECTION 1

Se1                            up             up       WAN CONNECTION 2



R2#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

Loopback0              2.2.2.2         YES manual         up                    up

Serial0                    12.1.1.2          YES manual         up                    up

Serial1                    21.1.1.2           YES manual         up                    up

===========================================================

Currently no BGP configuration on both the Routers

R1#sh ip bgp sum



% BGP not active


R2#sh ip bgp



% BGP not active

===========================================================

Here there are two links between R1 and R2.



Establishing two BGP Neighborship using both paths is not a solution.



We need to establish only one BGP Neighborship between R1 and R2.

and this can  be achieved using loopback interfaces



So by using loopback interfaces for BGP neighborship.

=>we have both the path available.



=> BGP Neighborship wont go down even when the physical interfaces go down since loopback interfaces never goes down



BGP Neighborship “ LOOPBACK “ interfaces are always preferred .


======================================================================

By default BGP packets source is the outgoing interface but BGP gives us an option to change the source of the BGP packet sent.

Here we can use loopback interface as source of BGP packets sent between R1 and R2.

Hence we need to change source of BGP packet which can be achieved using "update source" command .

======================================================================

eBGP Neighborship should be directly connected i.e. same subnet .

By default TTL value in BGP packet is 1 when it enters from one AS to another AS.

But here we are using loopback interfaces which are in different subnet and they are not directly connected to each other .

Hence need to specify the same using eBGP multihop command

======================================================================

!! Configuration of the loopback interfaces

R1(config)#int loopback 1

Dec 13 01:54:28.959: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

R1(config-if)#ip address 11.11.11.11 255.255.255.255

R1(config-if)#^Z

R2(config)#int loopback 1

Dec 13 01:55:33.523: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

R2(config-if)#ip address 22.22.22.22 255.255.255.255

R2(config-if)#^Z

=======================================================================



R1(config)#router bgp 100

R1(config-router)#neighbor 22.22.22.22 remote-as 200

R1(config-router)#neighbor 22.22.22.22 update-source loopback 1

R1(config-router)#neighbor 22.22.22.22 ebgp-multihop 2


R2(config)#router bgp 200

R2(config-router)#neighbor 11.11.11.11 remote-as 100

R2(config-router)#neighbor 11.11.11.11 update-source loopback 1

R2(config-router)#neighbor 11.11.11.11 ebgp-multihop 2


R1#sh ip bgp sum

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 8, main routing table version 8

1 network entries using 117 bytes of memory

1 path entries using 52 bytes of memory

2/1 BGP path/bestpath attribute entries using 248 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 417 total bytes of memory

BGP activity 2/1 prefixes, 4/3 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

22.22.22.22     4   200       0       0        0    0    0 never    Active



R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 8, main routing table version 8

1 network entries using 117 bytes of memory

1 path entries using 52 bytes of memory

2/1 BGP path/bestpath attribute entries using 248 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 417 total bytes of memory

BGP activity 2/1 prefixes, 4/3 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

11.11.11.11     4   100       0       0        0    0    0 never    Active


R1#ping 22.22.22.22 source loopback 1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 22.22.22.22, timeout is 2 seconds:

Packet sent with a source address of 11.11.11.11

.....

Success rate is 0 percent (0/5)



BGP Neighborship is unsuccessful.

SINCE THERE IS NO L3 Reachability between the loopback interfaces .

No TCP session is established between them.


!!debug output on R2

Dec 13 02:28:40.475: BGP: 11.11.11.11 active open failed - no route to peer, open active delayed 34828ms (35000ms max, 28% jitter)


There should Reachability Between 11.11.11.11 & 22.22.22.22

Lets configure static routes for same .

R1(config)#ip route 22.22.22.22 255.255.255.255 s0

R1(config)#ip route 22.22.22.22 255.255.255.255 s1



R2(config)#ip route 11.11.11.11 255.255.255.255 S0

R2(config)#ip route 11.11.11.11 255.255.255.255 S1



!!debug output on R2

Dec 13 02:28:51.843: BGP: 11.11.11.11 passive open to 22.22.22.22

Dec 13 02:28:51.843: BGP: 11.11.11.11 went from Active to Idle

Dec 13 02:28:51.843: BGP: 11.11.11.11 went from Idle to Connect

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcv message type 1, length (excl. header) 26

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcv OPEN, version 4, holdtime 180 seconds

Dec 13 02:28:51.847: BGP: 11.11.11.11 went from Connect to OpenSent

Dec 13 02:28:51.847: BGP: 11.11.11.11 sending OPEN, version 4, my as: 200, holdtime 180 seconds

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcv OPEN w/ OPTION parameter len: 16

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcvd OPEN w/ optional parameter type 2 (Capability) len 6

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has CAPABILITY code: 1, length 4

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has MP_EXT CAP for afi/safi: 1/1

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcvd OPEN w/ optional parameter type 2 (Capability) len 2

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has CAPABILITY code: 128, length 0

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has ROUTE-REFRESH capability(old) for all address-families

Dec 13 02:28:51.847: BGP: 11.11.11.11 rcvd OPEN w/ optional parameter type 2 (Capability) len 2

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has CAPABILITY code: 2, length 0

Dec 13 02:28:51.847: BGP: 11.11.11.11 OPEN has ROUTE-REFRESH capability(new) for all address-families

BGP: 11.11.11.11 rcvd OPEN w/ remote AS 100

Dec 13 02:28:51.847: BGP: 11.11.11.11 went from OpenSent to OpenConfirm

Dec 13 02:28:51.847: BGP: 11.11.11.11 send message type 1, length (incl. header) 45

Dec 13 02:28:51.851: BGP: 11.11.11.11 went from OpenConfirm to Established

Dec 13 02:28:51.851: %BGP-5-ADJCHANGE: neighbor 11.11.11.11 Up


R1#sh ip bgp summary

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 9, main routing table version 9

2 network entries using 234 bytes of memory

2 path entries using 104 bytes of memory

3/2 BGP path/bestpath attribute entries using 372 bytes of memory

1 BGP AS-PATH entries using 24 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 734 total bytes of memory

BGP activity 3/1 prefixes, 5/3 paths, scan interval 60 secs



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

22.22.22.22     4   200            13      13           9           0    0        00:08:21        1


R2#sh ip bgp summary


BGP router identifier 2.2.2.2, local AS number 200


BGP table version is 9, main routing table version 9


2 network entries using 234 bytes of memory


2 path entries using 104 bytes of memory


3/2 BGP path/bestpath attribute entries using 372 bytes of memory


1 BGP AS-PATH entries using 24 bytes of memory


0 BGP route-map cache entries using 0 bytes of memory


0 BGP filter-list cache entries using 0 bytes of memory


BGP using 734 total bytes of memory


BGP activity 3/1 prefixes, 5/3 paths, scan interval 60 secs




Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

11.11.11.11     4   100           14      14                     9    0    0           00:09:59        1



R1#sh ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

       E1 - OSPF external type 1, E2 - OSPF external type 2

       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

       ia - IS-IS inter area, * - candidate default, U - per-user static route

       o - ODR, P - periodic downloaded static route



Gateway of last resort is not set



     1.0.0.0/32 is subnetted, 1 subnets

C       1.1.1.1 is directly connected, Loopback0

     2.0.0.0/32 is subnetted, 1 subnets

B       2.2.2.2 [20/0] via 22.22.22.22, 00:12:15

     21.0.0.0/24 is subnetted, 1 subnets

C       21.1.1.0 is directly connected, Serial1

     22.0.0.0/32 is subnetted, 1 subnets

S       22.22.22.22 is directly connected, Serial1

     11.0.0.0/32 is subnetted, 1 subnets

C       11.11.11.11 is directly connected, Loopback1



R1#sh ip bgp

BGP table version is 9, 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

*> 1.1.1.1/32       0.0.0.0                  0           32768 i

*> 2.2.2.2/32       22.22.22.22              0             0    200       i

R2(config)#int s0

R2(config-if)#sh

R2(config-if)#^Z

Dec 13 02:44:47.415: %SYS-5-CONFIG_I: Configured from console by console

R2#sh ip bgp sum

BGP router identifier 2.2.2.2, local AS number 200

BGP table version is 9, main routing table version 9

2 network entries using 234 bytes of memory

2 path entries using 104 bytes of memory

3/2 BGP path/bestpath attribute entries using 372 bytes of memory

1 BGP AS-PATH entries using 24 bytes of memory

0 BGP route-map cache entries using 0 bytes of memory

0 BGP filter-list cache entries using 0 bytes of memory

BGP using 734 total bytes of memory

BGP activity 3/1 prefixes, 5/3 paths, scan interval 60 secs



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

11.11.11.11     4   100      20      20        9    0    0 00:15:59        1



POINTS TO REMEMBER
==========================
While using loopback address of eBGP configuration -


1)We need to change source of BGP packet which can be achieved using "update source" command .


2)Need to use eBGP multihop command.


3)THERE SHOULD BE Reachability BETWEEN loopback interfaces.


Thanks for the reading the blog !!!

Friday 24 April 2020

BGP CHAPTER 3 - ROUTER ID

BGP Router Identifier (BGP RID)-


It is the highest loopback IP address and in absence of loopback interface/s it will be the highest IP address of an active physical interface.

BGP Router must have BGP RID to establish BGP Peer session.

BGP router id can be also manually configured using bgp router-id command .

But once it is configured the bgp session will be reset.



R1#sh ip int brief

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0              unassigned      YES unset  administratively down down

Serial0                    12.1.1.1        YES manual up                    up

Serial1                    unassigned      YES unset  administratively down down

Serial2                    unassigned      YES unset  administratively down down


!! Currently BGP Router ID is 12.1.1.1


R1#sh ip bgp summary | i BGP router


BGP router identifier 12.1.1.1, local AS number 100


!! Configuration of loopback 0


R1(config)#int loopback 0

R1(config-if)#ip address 1.1.1.1 255.255.255.255

R1(config-if)#^Z


!! Change in BGP RID would need to reset the BGP sessions.HARD RESET IS REQUIRED .

Soft reset wont change the BGP RID .


R1#clear ip bgp *

R1#clear ip bgp all peer-group

Dec 11 11:11:39.911: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Down User reset

Dec 11 11:11:40.867: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Up

R1#sh ip bgp summary

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2        4   200      17      17        1    0    0 00:00:04        0



!! Configuration of loopback 1



R1(config)#int loopback 1

R1(config-if)#ip

Dec 11 11:17:25.827: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up

R1(config-if)#ip add

R1(config-if)#ip address  11.11.11.11 255.255.255.255

R1(config-if)#^Z



R1#clear ip bgp *

Dec 11 11:17:50.691: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Down User reset

Dec 11 11:17:51.323: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Up

R1#sh ip bgp summary

BGP router identifier 11.11.11.11, local AS number 100

BGP table version is 1, main routing table version 1



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2        4   200      27      27        1    0    0 00:00:02        0



R1(config)#no interface loopback 0

R1(config)#no interface loopback 1

R1(config)#int

Dec 11 11:19:42.095: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down

Dec 11 11:19:43.095: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down

R1(config)#int

Dec 11 11:19:43.623: %LINK-5-CHANGED: Interface Loopback1, changed state to administratively down

Dec 11 11:19:44.623: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to down

R1(config)#^Z

R1#

Dec 11 11:19:47.491: %SYS-5-CONFIG_I: Configured from console by console

R1#clear ip bgp *

R1#config

Dec 11 11:19:52.691: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Down User reset

R1#sh ip bgp summary

Dec 11 11:19:53.771: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Up

R1#sh ip bgp summary

BGP router identifier 12.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2        4   200      33      33        1    0    0 00:00:01        0

R1#



!! Setting BGP RID Manually




R1(config)#

R1(config)#router bgp 100

R1(config-router)#bgp router-id 100.1.1.1

R1(config-router)#^Z

R1#

Dec 11 11:21:49.995: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Down Router ID changed

R1#

Dec 11 11:21:51.003: %SYS-5-CONFIG_I: Configured from console by console

Dec 11 11:21:51.267: %BGP-5-ADJCHANGE: neighbor 12.1.1.2 Up

R1#sh ip bgp sum

BGP router identifier 100.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1



Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

12.1.1.2        4   200      38      38        1    0    0 00:00:12        0



Guys !!!! Please do remember once BGP RID is hard-cored the bgp session will be reset .

This may impact the production . So please be careful .



R2#sh ip bgp neighbors 12.1.1.1

BGP neighbor is 12.1.1.1,  remote AS 100, external link

  BGP version 4, remote router ID 100.1.1.1

  BGP state = Established, up for 00:00:44

  Last read 00:00:44, last write 00:00:44, hold time is 180, keepalive interval is 60 seconds

  Neighbor capabilities:

    Route refresh: advertised and received(old & new)

    Address family IPv4 Unicast: advertised and received

  Message statistics:

    InQ depth is 0

    OutQ depth is 0

                         Sent       Rcvd

    Opens:                  6          6

    Notifications:          0          0

    Updates:                0          0

    Keepalives:            41         41


Thanks for Reading !!!!!