My Countingdown

Tuesday, December 13, 2011

Lab 2. BGP - iBGP Peering - Loopback



Let’s make iBGP using loopback interface. If using physical interface only 'neighbor a.b.c.d remote-as zzz' for peering and 'network a.b.c.d mask 255.xxx.yyy.zzz' for advertize. Using loopback, we need to add some command such as ' neighbor a.b.c.d update-source loopback x'.

R1#
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
 ip address 100.100.100.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 12.12.12.1 255.255.255.0

R2#
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface Loopback1
 ip address 200.200.200.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 12.12.12.2 255.255.255.0

If using loopback for neighboring, need to introduce loopback first in the routing table. Because of that we need IGP if using loopback for neighboring in BGP.

R1#
router rip
 network 1.0.0.0
 network 12.0.0.0

R2#
router rip
 network 2.0.0.0
 network 12.0.0.0
  
After loopback can be ping, we can activate BGP.

R1(config)#router bgp 12
R1(config-router)#neighbor 2.2.2.2 remote-as 12
R1(config-router)#neighbor 2.2.2.2 update-source loopback0
R1(config-router)#net 100.100.100.1 mask 255.255.255.255

R2(config-router)#router bgp 12
R2(config-router)#nei 1.1.1.1 remot 12
R2(config-router)#nei 1.1.1.1 upd lo0
R2(config-router)#net 200.200.200.2 mask 255.255.255.255

Verify BGP routing

R1(config-router)#do sh ip rout
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

     200.200.200.0/32 is subnetted, 1 subnets
B       200.200.200.2 [200/0] via 2.2.2.2, 00:00:07
     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
R    2.0.0.0/8 [120/1] via 12.12.12.2, 00:00:05, FastEthernet0/0
     100.0.0.0/32 is subnetted, 1 subnets
C       100.100.100.1 is directly connected, Loopback1
     12.0.0.0/24 is subnetted, 1 subnets
C       12.12.12.0 is directly connected, FastEthernet0/0

R2(config-router)#do sh ip bgp summ
BGP router identifier 2.2.2.2, local AS number 12
BGP table version is 3, main routing table version 3
2 network entries using 240 bytes of memory
2 path entries using 104 bytes of memory
3/2 BGP path/bestpath attribute entries using 372 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
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of memory
BGP using 748 total bytes of memory
BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1            4    12       7           7              3           0     0      00:03:27        1

R2(config-router)#do sh ip bgp
BGP table version is 3, 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
*>i100.100.100.1/32 1.1.1.1                  0    100      0 i
*> 200.200.200.2/32 0.0.0.0                  0         32768 i

Make sure loopback 1 in R1 and R2 can be ping

R1(config-router)#do ping 200.200.200.2 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/33/56 ms

No comments:

Post a Comment