networking:cisco:bgp-basic

This is an old revision of the document!


Cisco : Border Gateway Protocol [U]

  • 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.

  • Apa itu Autonomous System (AS)?

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.

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><html><br></html> Tentukan Local BGP Router ID, Jika tidak akan terpilih otomatis
network <network_IP> mask <subnet_mask> Menngadvertise sebuah Network
Command Description
show ip bgp neighbors Show BGP Neighbors
.show ip bgp summary Show BGP Summary
show ip bgp<html><br></html>show ip route bgp

Preconfigurasi Konfigurasi IP

Preconfigurasi Konfigurasi IP

* R11 : Konfigurasi IP

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/1
R11(config-if)#ip address 192.168.12.1 255.255.255.0
R11(config-if)#no shutdown

* R12 : Konfigurasi IP

R12(config)#interface GigabitEthernet0/0
R12(config-if)#ip address 192.168.12.2 255.255.255.0
R12(config-if)#no shutdown

* R21 : Konfigurasi IP

R21(config)#interface GigabitEthernet0/0
R21(config-if)#ip address 192.168.21.2 255.255.255.0
R21(config-if)#no shutdown
R21(config-if)#exit
R21(config)#interface GigabitEthernet0/1
R21(config-if)#ip address 192.168.22.1 255.255.255.0
R21(config-if)#no shutdown

* R22 : Konfigurasi IP

R22(config)#interface GigabitEthernet0/0
R22(config-if)#ip address 192.168.22.2 255.255.255.0
R22(config-if)#no shutdown

* R31 : Konfigurasi IP

R31(config)#interface GigabitEthernet0/0
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/1
R31(config-if)#ip address 192.168.32.1 255.255.255.0
R31(config-if)#no shutdown

* R32 : Konfigurasi IP

R32(config)#interface GigabitEthernet0/0
R32(config-if)#ip address 192.168.32.2 255.255.255.0
R32(config-if)#no shutdown

* R0 : Konfigurasi IP

R0(config)#interface GigabitEthernet0/0
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/1
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/2
R0(config-if)#ip address 192.168.31.1 255.255.255.0
R0(config-if)#no shutdown

Preconfigurasi Routing

Preconfigurasi Routing

* R12 : Konfigurasi static default routing

R12(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1

* R11 : Konfigurasi static default routing

R11(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.1

* R21 : Konfigurasi ospf

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

* R22 : Konfigurasi ospf

R22(config)#router ospf 1
R22(config-router)#network 192.168.22.0 0.0.0.255 area 0

* R31 : Konfigurasi eigrp

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 

* R32 : Konfigurasi eigrp

R32(config)#router eigrp 1
R32(config-router)#network 192.168.32.0 0.0.0.255

* R0 : Konfigurasi static route, ospf , dan eigrp

R0(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2
R0(config)#router ospf 1
R0(config-router)#network 192.168.21.0 0.0.0.255 area 0
R0(config-router)#exit
R0(config)#router eigrp 1
R0(config-router)#network 192.168.31.0 0.0.0.255
R0(config-router)#exit

* R0 : Table Routing sebelum di redistribute

R0#show ip route 
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, 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/0
L       192.168.11.1/32 is directly connected, GigabitEthernet0/0
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/1
O    192.168.22.0/24 [110/2] via 192.168.21.2, 00:04:06, GigabitEthernet0/1
     192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.31.0/24 is directly connected, GigabitEthernet0/2
L       192.168.31.1/32 is directly connected, GigabitEthernet0/2
D    192.168.32.0/24 [90/3072] via 192.168.31.2, 00:03:23, GigabitEthernet0/2

* R21 : Table Routing sebelum di redistribute

R21#show ip route 
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, 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/0
     192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.22.0/24 is directly connected, GigabitEthernet0/1
L       192.168.22.1/32 is directly connected, GigabitEthernet0/1

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…

R0(config)#router ospf 1
R0(config-router)#redistribute connected subnet
R0(config-router)#redistribute static subnets 
R0(config-router)#redistribute eigrp 1 subnets 

tanpa subnets redistribution hanya mendukung classfull subnets. Dengan subnets redistribution mendukung vlsm walaupun pada percobaan ini subnets classfull.

R0(config)#router eigrp 1
R0(config-router)#redistribute ospf 1 metric 10000 100 255 1 1500
R0(config-router)#redistribute static metric 10000 100 255 1 1500
R0(config-router)#redistribute connected metric 10000 100 255 1 1500

Untuk redistribute OSPF ke EIGRP pastikan anda menentukan metricnya. Terkadang route tidak terdistribusikan apabila anda tidak menentukanya.

* R22 : Table Routing setelah kite mendistribute route

R22#show ip route 
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, 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
 
O E2 192.168.11.0/24 [110/20] via 192.168.22.1, 01:01:14, GigabitEthernet0/0
O E2 192.168.12.0/24 [110/20] via 192.168.22.1, 01:03:09, GigabitEthernet0/0
O    192.168.21.0/24 [110/2] via 192.168.22.1, 01:18:37, GigabitEthernet0/0
     192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks
C       192.168.22.0/24 is directly connected, GigabitEthernet0/0
L       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/0
O E2 192.168.32.0/24 [110/20] via 192.168.22.1, 01:01:04, GigabitEthernet0/0

* R32 : Table Routing setelah kite mendistribute route

R32#show ip route 
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, 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
 
D EX 192.168.11.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/0
D EX 192.168.12.0/24 [170/5632] via 192.168.32.1, 01:00:22, GigabitEthernet0/0
D EX 192.168.21.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/0
D EX 192.168.22.0/24 [170/282112] via 192.168.32.1, 00:39:29, GigabitEthernet0/0
D    192.168.31.0/24 [90/3072] via 192.168.32.1, 01:22:25, GigabitEthernet0/0
     192.168.32.0/24 is variably subnetted, 2 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

* Test Ping

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
R12#ping 192.168.32.2
 
Type escape sequence to abort.
Sending 5, 100-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
  • networking/cisco/bgp-basic.1770217860.txt.gz
  • Last modified: 2026/02/04 22:11
  • by ilyasa