networking:cisco:bgp-basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
networking:cisco:bgp-basic [2026/02/04 22:07] – [Cisco : Border Gateway Protocol [U]] ilyasanetworking:cisco:bgp-basic [2026/02/04 22:27] (current) – [Cisco : Border Gateway Protocol [U]] ilyasa
Line 1: Line 1:
 {{indexmenu_n>057}} {{indexmenu_n>057}}
-====== Cisco : Border Gateway Protocol [U]  ======+====== Cisco : Border Gateway Protocol ======
   * **Apa itu BGP?**   * **Apa itu BGP?**
 Border Gateway Protocol (BGP) adalah protokol routing yang menjadi tulang punggung komunikasi di Internet. BGP bertugas mengelola lalu lintas antar jaringan atau Autonomous System (AS), dengan memilih jalur terbaik untuk mengirimkan data ke tujuan tertentu. Dengan BGP, router dapat bertukar informasi tentang rute mana yang lebih efisien dan andal untuk mencapai jaringan lain, memungkinkan Internet berfungsi secara global. Border Gateway Protocol (BGP) adalah protokol routing yang menjadi tulang punggung komunikasi di Internet. BGP bertugas mengelola lalu lintas antar jaringan atau Autonomous System (AS), dengan memilih jalur terbaik untuk mengirimkan data ke tujuan tertentu. Dengan BGP, router dapat bertukar informasi tentang rute mana yang lebih efisien dan andal untuk mencapai jaringan lain, memungkinkan Internet berfungsi secara global.
Line 8: Line 8:
 Autonomous System (AS) adalah sekumpulan jaringan yang dioperasikan di bawah satu administrasi atau penyedia layanan internet (ISP). Setiap AS memiliki Nomor AS (ASN) yang unik, yang berfungsi sebagai identitas di Internet. ASN ini memungkinkan jaringan saling terhubung dan berkomunikasi secara efektif, serta mempermudah pengelolaan rute di antara berbagai organisasi yang mengelola infrastruktur jaringan. Autonomous System (AS) adalah sekumpulan jaringan yang dioperasikan di bawah satu administrasi atau penyedia layanan internet (ISP). Setiap AS memiliki Nomor AS (ASN) yang unik, yang berfungsi sebagai identitas di Internet. ASN ini memungkinkan jaringan saling terhubung dan berkomunikasi secara efektif, serta mempermudah pengelolaan rute di antara berbagai organisasi yang mengelola infrastruktur jaringan.
 ===== Syntax ===== ===== Syntax =====
 +Berikut adallah syntax command yang digunakan dalam konfigurasi BGP (Border Gateway Protocol).
 +^Command                                              ^Description                                                    ^
 +|''%%router bgp <AS_number>%%''                     |Semasuki BGP Configuration Mode:                               |
 +|.''%%neighbor <IP_address> remote-as <AS_number>%%''*|Tentukan AS Tetangga (Remote Peer)                             |
 +|''%%bgp router-id <IP_address>%%'' |Tentukan Local BGP Router ID, Jika tidak akan terpilih otomatis|
 +|''%%network <network_IP> mask <subnet_mask>%%''      |Menngadvertise sebuah Network                                  |
  
-Sintaks dasar untuk meredistribusi rute di Cisco: 
  
-<code> +^Command                             ^Description       ^ 
-router <nama-protokol> +|''%%show ip bgp neighbors%%''       |Show BGP Neighbors| 
- redistribute <protokol-sumber> [metric <nilai>] [subnet] +|.''%%show ip bgp summary%%''        |Show BGP Summary  | 
- exit +|''%%show ip bgp%%'' |show ip route bgp |
-</code>+
  
-  * nama-protokol: Nama protokol routing yang sedang dikonfigurasi (misalnya, RIP, OSPF, EIGRP). 
-  * protokol-sumber: Protokol routing yang rute-nya ingin didistribusikan (misalnya, static, connected, EIGRP). 
-  * metric: Opsional. Mengizinkan Anda untuk mengubah metrik default untuk rute yang didistribusikan. 
-  * subnet: Opsional. Mengizinkan Anda untuk menentukan subnet spesifik yang akan didistribusikan. 
- 
-Contoh: 
- 
-Mari redistribusikan rute statis ke EIGRP: 
  
 +===== Topologi =====
 +{{ :networking:cisco:cisco_bgp-top.png?nolink |}}
 +<hidden Preconfig>
 +* **R1 : Setting Interface**
 <code> <code>
-router eigrp 100 +interface FastEthernet0/0 
- redistribute static metric 255 + ip address 192.168.1.1 255.255.255.0 
- exit + no shutdown
-</code> +
-Perintah ini mendistribusikan semua rute statis ke EIGRP dengan metrik 255.+
  
-===== Topologi ===== +interface Serial1/0 
-{{ :networking:cisco:cisco_redis.png?nolink |}} + ip address 10.0.0.1 255.255.255.252 
-<hidden Preconfigurasi Konfigurasi IP> + clock rate 2000000 
-* **R11 : Konfigurasi IP** + no shutdown
-<code js> +
-R11(config)#interface GigabitEthernet0/0 +
-R11(config-if)#ip address 192.168.11.2 255.255.255.0 +
-R11(config-if)#no shutdown +
-R11(config-if)#exit +
-R11(config)#interface GigabitEthernet0/+
-R11(config-if)#ip address 192.168.12.1 255.255.255.0 +
-R11(config-if)#no shutdown+
 </code> </code>
-* **R12 Konfigurasi IP** +* **R2 Setting Interface** 
-<code js+<code> 
-R12(config)#interface GigabitEthernet0/0 +interface FastEthernet0/0 
-R12(config-if)#ip address 192.168.12.2 255.255.255.0 + ip address 192.168.2.1 255.255.255.0 
-R12(config-if)#no shutdown+ no shutdown 
 +
 +interface Serial1/0 
 + ip address 10.0.0.2 255.255.255.252 
 + no shutdown
 </code> </code>
-* **R21 Konfigurasi IP** +* **LAN1 Setting Interface** 
-<code js+<code> 
-R21(config)#interface GigabitEthernet0/0 +interface FastEthernet0/0 
-R21(config-if)#ip address 192.168.21.2 255.255.255.0 + ip address 192.168.1.2 255.255.255.0 
-R21(config-if)#no shutdown + no shutdown
-R21(config-if)#exit +
-R21(config)#interface GigabitEthernet0/+
-R21(config-if)#ip address 192.168.22.1 255.255.255.0 +
-R21(config-if)#no shutdown+
 </code> </code>
-* **R22 Konfigurasi IP** +* **LAN2 Setting Interface** 
-<code js+<code> 
-R22(config)#interface GigabitEthernet0/0 +interface FastEthernet0/0 
-R22(config-if)#ip address 192.168.22.2 255.255.255.0 + ip address 192.168.2.2 255.255.255.0 
-R22(config-if)#no shutdown + no shutdown
-</code> +
-* **R31 : Konfigurasi IP** +
-<code js> +
-R31(config)#interface GigabitEthernet0/+
-R31(config-if)#ip address 192.168.31.2 255.255.255.0 +
-R31(config-if)#no shutdown +
-R31(config-if)#exit +
-R31(config)#interface GigabitEthernet0/+
-R31(config-if)#ip address 192.168.32.1 255.255.255.0 +
-R31(config-if)#no shutdown +
-</code> +
-* **R32 : Konfigurasi IP** +
-<code js> +
-R32(config)#interface GigabitEthernet0/+
-R32(config-if)#ip address 192.168.32.2 255.255.255.0 +
-R32(config-if)#no shutdown +
-</code> +
-* **R0 : Konfigurasi IP** +
-<code js> +
-R0(config)#interface GigabitEthernet0/+
-R0(config-if)#ip address 192.168.11.1 255.255.255.0 +
-R0(config-if)#no shutdown +
-R0(config-if)#exit +
-R0(config)#interface GigabitEthernet0/+
-R0(config-if)#ip address 192.168.21.1 255.255.255.0 +
-R0(config-if)#no shutdown +
-R0(config-if)#exit +
-R0(config)#interface GigabitEthernet0/+
-R0(config-if)#ip address 192.168.31.1 255.255.255.0 +
-R0(config-if)#no shutdown+
 </code> </code>
 +
 </hidden> </hidden>
  
-<hidden Preconfigurasi Routing> 
-* **R12 : Konfigurasi static  default routing** 
-<code js> 
-R12(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1 
-</code> 
-* **R11 : Konfigurasi static  default routing** 
-<code js> 
-R11(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.1 
-</code> 
-* **R21 : Konfigurasi ospf** 
-<code js> 
-R21(config)#router ospf 1 
-R21(config-router)#network 192.168.21.0 0.0.0.255 area 0 
-R21(config-router)#network 192.168.22.0 0.0.0.255 area 0 
-</code> 
-* **R22 : Konfigurasi ospf** 
-<code js> 
-R22(config)#router ospf 1 
-R22(config-router)#network 192.168.22.0 0.0.0.255 area 0 
-</code> 
-* **R31 : Konfigurasi eigrp** 
-<code js> 
-R31(config)#router eigrp 1 
-R31(config-router)#network 192.168.31.0 0.0.0.255  
-R31(config-router)#network 192.168.32.0 0.0.0.255  
-</code> 
-* **R32 : Konfigurasi eigrp** 
-<code js> 
-R32(config)#router eigrp 1 
-R32(config-router)#network 192.168.32.0 0.0.0.255 
-</code> 
-* **R0 : Konfigurasi static route, ospf , dan eigrp** 
-<code js> 
-R0(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2 
-</code> 
- 
-<code js> 
-R0(config)#router ospf 1 
-R0(config-router)#network 192.168.21.0 0.0.0.255 area 0 
-R0(config-router)#exit 
-</code> 
- 
-<code js> 
-R0(config)#router eigrp 1 
-R0(config-router)#network 192.168.31.0 0.0.0.255 
-R0(config-router)#exit 
-</code> 
- 
-</hidden> 
 ===== Konfigurasi ===== ===== Konfigurasi =====
-* **R0 Table Routing sebelum di redistribute**+  * **R1 Configurasi BGP**
 <code js> <code js>
-R0#show ip route  +router bgp 100 
-Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP + neighbor 10.0.0.2 remote-as 200 
-       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + network 192.168.1.0 mask 255.255.255.0
-       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 +
-       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP +
-       i - IS-IS, 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 +
- +
-     192.168.11.0/24 is variably subnetted, 2 subnets, 2 masks +
-C       192.168.11.0/24 is directly connected, GigabitEthernet0/+
-L       192.168.11.1/32 is directly connected, GigabitEthernet0/+
-S    192.168.12.0/24 [1/0] via 192.168.11.2 +
-     192.168.21.0/24 is variably subnetted, 2 subnets, 2 masks +
-C       192.168.21.0/24 is directly connected, GigabitEthernet0/1 +
-L       192.168.21.1/32 is directly connected, GigabitEthernet0/+
-O    192.168.22.0/24 [110/2] via 192.168.21.2, 00:04:06, GigabitEthernet0/+
-     192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks +
-C       192.168.31.0/24 is directly connected, GigabitEthernet0/+
-L       192.168.31.1/32 is directly connected, GigabitEthernet0/+
-D    192.168.32.0/24 [90/3072] via 192.168.31.2, 00:03:23, GigabitEthernet0/2+
 </code> </code>
-* **R21 Table Routing sebelum di redistribute**+  * **R2 Configurasi BGP**
 <code js> <code js>
-R21#show ip route  +router bgp 200 
-Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP + neighbor 10.0.0.1 remote-as 100 
-       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area + network 192.168.2.0 mask 255.255.255.0
-       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 +
-       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP +
-       i - IS-IS, 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 +
- +
-     192.168.21.0/24 is variably subnetted, 2 subnets, 2 masks +
-C       192.168.21.0/24 is directly connected, GigabitEthernet0/0 +
-L       192.168.21.2/32 is directly connected, GigabitEthernet0/+
-     192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks +
-C       192.168.22.0/24 is directly connected, GigabitEthernet0/+
-L       192.168.22.1/32 is directly connected, GigabitEthernet0/1+
 </code> </code>
  
-Table routing pada R0 tersimpan rute kesemua network akan tetapi pada R21 hanya mendapatkan advertaise rute ospf dari R0. Untuk R0 dapat membagikan table routing ke protocol lain (misal eigrp) maka kita perlu mendistribusikan eigrp pada ospf. DST… +===== Testing ===== 
- +* **R1 : BGP Neighbors **
-==== Redistrubute Conntected, Static,dan EIGRP ke table routing OSPF. ====+
 <code js> <code js>
-R0(config)#router ospf +R1#show ip bgp neighbors  
-R0(config-router)#redistribute connected subnet +BGP neighbor is 10.0.0.2,  remote AS 200, external link 
-R0(config-router)#redistribute static subnets  +  BGP version 4, remote router ID 192.168.2.
-R0(config-router)#redistribute eigrp subnets  +  BGP state = Established, up for 00:00:36 
-</code> +  Last read 00:00:06, last write 00:00:06, hold time is 180, keepalive interval is 60 seconds 
-<WRAP center round info 100%> +  Neighbor capabilities: 
-tanpa ''%%subnets%%'' redistribution hanya mendukung classfull subnets. Dengan ''%%subnets%%'' redistribution mendukung vlsm walaupun pada percobaan ini subnets classfull. +    Route refresh: advertised and received(old & new) 
-</WRAP>+    Address family IPv4 Unicast: advertised and received 
 +  Message statistics: 
 +    InQ depth is 0 
 +    OutQ depth is 0 
 +                         Sent       Rcvd 
 +    Opens:                  1          
 +    Notifications:          0          0 
 +    Updates:                1          1 
 +    Keepalives:                      2 
 +    Route Refresh:          0          0 
 +    Total:                  4          4 
 +  Default minimum time between advertisement runs is 30 seconds
  
-==== Redistrubute Static, EIGRP ke table routing EIGRP. == + For address family: IPv4 Unicast 
-<code js> +  BGP table version 3, neighbor version 3/0 
-R0(config)#router eigrp + Output queue size : 0 
-R0(config-router)#redistribute ospf metric 10000 100 255 1500 +  Index 1, Offset 0, Mask 0x2 
-R0(config-router)#redistribute static metric 10000 100 255 1 1500 +  1 update-group member 
-R0(config-router)#redistribute connected metric 10000 100 255 1500+                                 Sent       Rcvd 
 +  Prefix activity:               ----       ---- 
 +    Prefixes Current:                        1 (Consumes 52 bytes) 
 +    Prefixes Total:                          
 +    Implicit Withdraw:              0          0 
 +    Explicit Withdraw:              0          0 
 +    Used as bestpath:             n/         1 
 +    Used as multipath:            n/a          0 
 +           
 +                                   Outbound    Inbound 
 +  Local Policy Denied Prefixes:    --------    ------- 
 +    Bestpath from this peer:                     n/a 
 +    Total:                                         0 
 +  Number of NLRIs in the update sent: max 1, min 1 
 +           
 +  Connections established 1; dropped 0 
 +  Last reset never 
 +Connection state is ESTAB, I/O status: 1, unread input bytes: 0             
 +Connection is ECN Disabled, Mininum incoming TTL 0, Outgoing TTL 1 
 +Local host: 10.0.0.1, Local port: 59207 
 +Foreign host: 10.0.0.2, Foreign port: 179 
 +           
 +Enqueued packets for retransmit: 0, input: 0  mis-ordered: 0 (0 bytes
 +           
 +Event Timers (current time is 0x6A9880)
 +Timer          Starts    Wakeups            Next 
 +Retrans                      0             0x0 
 +TimeWait            0          0             0x0 
 +AckHold                                  0x0 
 +SendWnd                      0             0x0 
 +KeepAlive                    0             0x0 
 +GiveUp              0          0             0x0 
 +PmtuAger            0          0             0x0 
 +DeadWait            0          0             0x0 
 +           
 +iss: 3940290831  snduna: 3940290967  sndnxt: 3940290967     sndwnd:  16249 
 +irs: 2763685506  rcvnxt: 2763685642  rcvwnd:      16249  delrcvwnd:    135 
 +           
 +SRTT: 124 ms, RTTO: 1405 ms, RTV: 1281 ms, KRTT: 0 ms 
 +minRTT: 20 ms, maxRTT: 300 ms, ACK hold: 200 ms 
 +Flags: active open, nagle 
 +IP Precedence value : 6 
 +           
 +Datagrams (max data segment is 1460 bytes): 
 +Rcvd: 5 (out of order: 0), with data: 3, total data bytes: 135 
 +Sent: 7 (retransmit: 0, fastretransmit: 0, partialack: 0, Second Congestion: 0), with data: 4, total data bytes: 135
 </code> </code>
-<WRAP center round info 100%> +* **R1 BGP Sumarry**
-Untuk redistribute OSPF ke EIGRP pastikan anda menentukan metricnya. Terkadang route tidak terdistribusikan apabila anda tidak menentukanya. +
-</WRAP> +
- +
- +
-===== Testing ===== +
-* **R22 Table Routing setelah kite mendistribute route**+
 <code js> <code js>
-R22#show ip route  +R1#show ip bgp summary    
-Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP +BGP router identifier 192.168.1.1, local AS number 100 
-       D - EIGRPEX - EIGRP external, O - OSPF, IA - OSPF inter area +BGP table version is 3main routing table version 3 
-       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type +network entries using 234 bytes of memory 
-       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP +path entries using 104 bytes of memory 
-       i - IS-IS, L1 - IS-IS level-1, L2 IS-IS level-2, ia - IS-IS inter area +3/2 BGP path/bestpath attribute entries using 372 bytes of memory 
-       * - candidate default, U - per-user static route, o ODR +BGP AS-PATH entries using 24 bytes of memory 
-       P periodic downloaded static route +0 BGP route-map cache entries using 0 bytes of memory 
- +0 BGP filter-list cache entries using 0 bytes of memory 
-Gateway of last resort is not set+BGP using 734 total bytes of memory 
 +BGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secs
  
-O E2 192.168.11.0/24 [110/20] via 192.168.22.1, 01:01:14, GigabitEthernet0/0 +Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd 
-O E2 192.168.12.0/24 [110/20] via 192.168.22.1, 01:03:09, GigabitEthernet0/0 +10.0.0.2          200             6        3    0    0 00:02:27        1
-O    192.168.21.0/24 [110/2] via 192.168.22.1, 01:18:37, GigabitEthernet0/+
-     192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks +
-      192.168.22.0/24 is directly connected, GigabitEthernet0/+
-      192.168.22.2/32 is directly connected, GigabitEthernet0/0 +
-O E2 192.168.31.0/24 [110/20] via 192.168.22.1, 01:01:14, GigabitEthernet0/+
-O E2 192.168.32.0/24 [110/20] via 192.168.22.1, 01:01:04, GigabitEthernet0/0+
 </code> </code>
- +* **R1 Tables Routing** 
-* **R32 Table Routing setelah kite mendistribute route** +<code> 
-<code js+R1#show ip route  
-R32#show ip route  +Codes: C - connected, S - static, R - RIP, M - mobile, B - 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 
-       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area+
        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
-       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP +       E1 - OSPF external type 1, E2 - OSPF external type 2 
-       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area +       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 
-       * - candidate default, U - per-user static routeo - ODR +       ia - IS-IS inter area* - candidate default, U - per-user static route 
-       P - periodic downloaded static route+       o - ODRP - periodic downloaded static route
  
 Gateway of last resort is not set Gateway of last resort is not set
  
-D EX 192.168.11.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/0 +     10.0.0.0/30 is subnetted, subnets 
-D EX 192.168.12.0/24 [170/5632] via 192.168.32.1, 01:00:22, GigabitEthernet0/+C       10.0.0.0 is directly connected, Serial1/0 
-D EX 192.168.21.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/+C    192.168.1.0/24 is directly connected, FastEthernet0/0 
-D EX 192.168.22.0/24 [170/282112] via 192.168.32.1, 00:39:29, GigabitEthernet0/+B    192.168.2.0/24 [20/0] via 10.0.0.2, 00:02:33
-D    192.168.31.0/24 [90/3072] via 192.168.32.1, 01:22:25, GigabitEthernet0/+
-     192.168.32.0/24 is variably subnetted, subnets, 2 masks +
-C       192.168.32.0/24 is directly connected, GigabitEthernet0/0 +
-L       192.168.32.2/32 is directly connected, GigabitEthernet0/0 +
-</code> +
-* **Test Ping** +
-<code js> +
- +
-R12#ping 192.168.22.2 +
- +
-Type escape sequence to abort. +
-Sending 5, 100-byte ICMP Echos to 192.168.22.2, timeout is 2 seconds: +
-!!!!! +
-Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms +
-</code> +
- +
-<code js> +
-R12#ping 192.168.32.2 +
- +
-Type escape sequence to abort. +
-Sending 5100-byte ICMP Echos to 192.168.32.2, timeout is 2 seconds: +
-!!!!! +
-Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms+
 </code> </code>
  • networking/cisco/bgp-basic.1770217652.txt.gz
  • Last modified: 2026/02/04 22:07
  • by ilyasa