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 show ip route bgp

Preconfig

Preconfig

* R1 : Setting Interface

interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown

interface Serial1/0
 ip address 10.0.0.1 255.255.255.252
 clock rate 2000000
 no shutdown

* R2 : Setting Interface

interface FastEthernet0/0
 ip address 192.168.2.1 255.255.255.0
 no shutdown
!
interface Serial1/0
 ip address 10.0.0.2 255.255.255.252
 no shutdown

* LAN1 : Setting Interface

interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 no shutdown

* LAN2 : Setting Interface

interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.0
 no shutdown

* 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.1770218351.txt.gz
  • Last modified: 2026/02/04 22:19
  • by ilyasa