My Countingdown

Tuesday, December 13, 2011

Lab 4. BGP - eBGP Peering - Loopback – eBGP Multihop




Let’s make eBGP using loopback interface. Same thing like iBGP using physical interface, add command '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 ' neighbor a.b.c.d update-source loopback x' and 'neighbor a.b.c.d ebgp-multihop'. Let's practice :)

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 1
R1(config-router)#neighbor 2.2.2.2 remote-as 2
R1(config-router)#neighbor 2.2.2.2 update-source loopback0
R1(config-router)#neighbor 2.2.2.2 ebgp-multihop
R1(config-router)#net 100.100.100.1 mask 255.255.255.255

R2(config-router)#router bgp 2
R2(config-router)#nei 1.1.1.1 remot 1
R2(config-router)#nei 1.1.1.1 upd lo0
R2(config-router)#nei 1.1.1.1 ebgp-multihop
R2(config-router)#net 200.200.200.2 mask 255.255.255.255

Verify BGP routing

R2(config-router)#do sh ip rou
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
C       200.200.200.2 is directly connected, Loopback1
R    1.0.0.0/8 [120/1] via 12.12.12.1, 00:00:18, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     100.0.0.0/32 is subnetted, 1 subnets
B       100.100.100.1 [20/0] via 1.1.1.1, 00:00:29
     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 sum
BGP router identifier 200.200.200.2, local AS number 2
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
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
Bitfield cache entries: current 1 (at peak 1) using 32 bytes of memory
BGP using 772 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     1       5                5           3          0     0      00:01:07        1

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

Make sure can ping

R2(config-router)#do ping 100.100.100.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/38/76 ms

No comments:

Post a Comment