Selasa, 14 Maret 2017

Konfigurasi iBGP

Alasan iBGP dipakai salahsatunya agar AS tersebut menjadi AS transit. Lebih lengkapnya bisa baca tulisan sebelumnya BGP NEIGBORSHIP: IBGP DAN EBGP. Buatlah topologi dibawah menggunakan GNS3.
image

Step 1

iBGP berjalan diatas protocol IGP. Disini saya memasang iBGP diatas OSPF.
!R1
int e0/0
ip add 12.12.12.1 255.255.255.0
no sh
ip ospf 10 area 0
int e0/1
ip add 14.14.14.1 255.255.255.0
no sh
ip ospf 10 area 0

!R2
int e0/0
ip add 12.12.12.2 255.255.255.0
no sh
ip ospf 10 area 0
int e0/1
ip add 23.23.23.2 255.255.255.0
no sh
ip ospf 10 area 0

!R3
int e0/0
ip add 34.34.34.3 255.255.255.0
no sh
ip ospf 10 area 0
int e0/1
ip add 23.23.23.3 255.255.255.0
no sh
ip ospf 10 area 0

!R4
int e0/0
ip add 34.34.34.4 255.255.255.0
no sh
ip ospf 10 area 0
int e0/1
ip add 14.14.14.4 255.255.255.0
no sh
ip ospf 10 area 0
Pastikan OSPF sudah berjalan dan reachable ke semua router.
R1#sh ip route
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.12.12.0/24 is directly connected, Ethernet0/0
L        12.12.12.1/32 is directly connected, Ethernet0/0
      14.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        14.14.14.0/24 is directly connected, Ethernet0/1
L        14.14.14.1/32 is directly connected, Ethernet0/1
      23.0.0.0/24 is subnetted, 1 subnets
O        23.23.23.0 [110/20] via 12.12.12.2, 00:06:12, Ethernet0/0
      34.0.0.0/24 is subnetted, 1 subnets
O        34.34.34.0 [110/20] via 14.14.14.4, 00:06:22, Ethernet0/1
R1#ping 23.23.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.23.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 5/5/7 ms
R1#ping 34.34.34.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 34.34.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 6/6/7 ms

Step 2

Lakukan konfigurasi iBGP dengan AS 1234.
R1(config)#router bgp 1234
R1(config-router)#neighbor 12.12.12.2 remote-as 1234
R1(config-router)#neighbor 14.14.14.4 remote-as 1234

R2(config)#router bgp 1234
R2(config-router)#neighbor 12.12.12.1 remote-as 1234
R2(config-router)#neighbor 23.23.23.3 remote-as 1234

R3(config)#router bgp 1234
R3(config-router)#neighbor 23.23.23.2 remote-as 1234
R3(config-router)#neighbor 34.34.34.4 remote-as 1234

R4(config)#router bgp 1234
R4(config-router)#neighbor 34.34.34.3 remote-as 1234
R4(config-router)#neighbor 14.14.14.1 remote-as 1234
Untuk pengecekan bgp, digunakan perintah “show ip bgp” dan “show ip bgp summary”. Sebelumnya kita buat suatu network terlebih dahulu lalu advertise via BGP di R1.
*Yang perlu diperhatikan adalah ketika mengadvertise network ke bgp, masknya harus sama antara interface dan network yang diadvertise. Misal jika mengadvertise network 11.11.11.11/32 maka di BGP ketikkan konfigurasi network 11.11.11.11 mask 255.255.255.255. Jika mask yang dimasukkan berbeda maka network tidak akan diadvertise oleh BGP.
R1(config)#int lo10
R1(config-if)#ip add 11.11.11.11 255.255.255.255
R1(config-if)#router bgp 1234
R1(config-router)#network 11.11.11.11 mask 255.255.255.255

R1#sh ip bgp summary
BGP router identifier 14.14.14.1, local AS number 1234
BGP table version is 2, main routing table version 2
1 network entries using 144 bytes of memory
1 path entries using 60 bytes of memory
1/1 BGP path/bestpath attribute entries using 136 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 340 total bytes of memory
BGP activity 1/0 prefixes, 1/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.2      4         1234      10      12        2    0    0 00:06:17        0
14.14.14.4      4         1234      10      12        2    0    0 00:05:33        0
R1#
R1#sh ip bgp
BGP table version is 2, local router ID is 14.14.14.1
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
 *>  11.11.11.11/32   0.0.0.0                  0         32768 i
Neighbor = Menandakan neighborship (peering) yang telah terbentuk.
V = Versi protocol BGP yang digunakan.
AS = Autonomous System, jika sama berarti peering iBGP, jika beda berarti eBGP.
State/PfxRcd = Status BGP/jumlah prefix yang diadvertise oleh neighbor tsb.
Jika state BGP active atau idle, artinya router telah mengirim open message dan sedang menunggu response. Hal tersebut bisa terjadi karena:
- Neighbor peering dengan address yang salah
- Neighbor tidak dikonfigurasi untuk peering dengan router tsb
- AS number miskonfiguration
- Neighbor tidak tahu route untuk menuju router yang mengirimkan open message (not reachable)

Problem

Coba cek di R2, R3 dan R4 apakah sudah ada prefix 11.11.11.11/32 yang diadvertise oleh R1.
R2#sh ip bgp sum
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.1      4         1234      27      25        2    0    0 00:19:39        1
23.23.23.3      4         1234      23      24        2    0    0 00:19:16        0
R2#sh ip bgp
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 11.11.11.11/32   12.12.12.1               0    100      0 i

R3#sh ip bgp sum
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
23.23.23.2      4         1234      25      24        1    0    0 00:20:16        0
34.34.34.4      4         1234      25      25        1    0    0 00:19:54        0
R3#sh ip bgp

R4#sh ip bgp sum
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
14.14.14.1      4         1234      28      27        2    0    0 00:20:18        1
34.34.34.3      4         1234      25      25        2    0    0 00:20:17        0
R4#sh ip bgp   
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 11.11.11.11/32   14.14.14.1               0    100      0 i
R2 dan R4 telah ada prefix 11.11.11.11/32 namun tidak di R3. Hal ini karena adanya rule “BGP No Split Horizon”, artinya update yang dikirim dari sebuah router iBGP neighbor tidak akan diteruskan ke neighbor yang lain (just for itself). Hal ini adalah cara iBGP untuk mencegah routing loops.
BGP SPLIT HORIZON
Agar semua router mendapatkan prefix tsb ada 2 cara yang dilakukan:
· Fullmesh = iBGP harus dikonfigurasi full mesh. Yaitu dengan peering ke semua router. Fullmesh disini tidak harus secara physical, tapi logical dengan syarat destination peeringnya harus reachable via IGP. Inilah yang akan kita gunakan.
· Route reflector = Ada router khusus yang peering ke semua router, dan router lain cukup peering ke RR. RR bertugas mengirimkan update ke semua router yang peering ke dia.
R1(config)#router bgp 1234
R1(config-router)#neighbor 23.23.23.3 remote-as 1234

R2(config)#router bgp 1234
R2(config-router)#neighbor 34.34.34.4 remote-as 1234

R3(config)#router bgp 1234
R3(config-router)#neighbor 12.12.12.1 remote-as 1234

R4(config)#router bgp 1234
R4(config-router)#neighbor 23.23.23.2 remote-as 1234
Lakukan verifikasi di R2,R3 dan R4. Pastikan semuanya memperoleh prefix 11.11.11.11/32 dari R1 dan bisa ping.
R2#sh ip bgp sum | b Ne
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.1      4         1234      48      47        2    0    0 00:39:13        1
23.23.23.3      4         1234      45      45        2    0    0 00:38:49        0
34.34.34.4      4         1234      10      10        2    0    0 00:05:05        0
R2#sh ip bgp | b Ne   
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 11.11.11.11/32   12.12.12.1               0    100      0 i

R3#sh ip bgp sum | b Ne
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
12.12.12.1      4         1234      13      11        2    0    0 00:06:39        1
23.23.23.2      4         1234      47      46        2    0    0 00:40:06        0
34.34.34.4      4         1234      47      46        2    0    0 00:39:44        0
R3#sh ip bgp | b Ne   
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 11.11.11.11/32   12.12.12.1               0    100      0 i

R4#sh ip bgp sum | b Ne
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
14.14.14.1      4         1234      50      49        2    0    0 00:40:13        1
23.23.23.2      4         1234      12      12        2    0    0 00:06:50        0
34.34.34.3      4         1234      47      47        2    0    0 00:40:12        0
R4#sh ip bgp | b Ne   
     Network          Next Hop            Metric LocPrf Weight Path
 *>i 11.11.11.11/32   14.14.14.1               0    100      0 i
Cek routing table di R3 maka akan muncul route 11.11.11.11/32 dengan keterangan BGP.
R3#sh ip route bgp
Codes: L - local, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

      11.0.0.0/32 is subnetted, 1 subnets
B        11.11.11.11 [200/0] via 12.12.12.1, 00:09:00
R3#ping 11.11.11.11
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 11.11.11.11, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Oksip...
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
 

Delivered by FeedBurner