BGP Attribute MED (Metric Existing Deskriminator)
Topologinya masih sama dengan Lab sebelumnya yaitu Lab BGP Attribute Weight
hanya saja di lab ini protocol routing IGPnya tidak menggunakan OSPF namun
menggunakan EIGRP. Kalau di lab BGP Attribute Weight di konfigurasi di R2
sebagai decision/pemilih jalur,nah kalau di BGP Attribute MED di Router Existing yang menuju keluar
di lab ini Router Existing yaitu R3.
Apabila menggunakan Attribute MED, maka BGP akan memilih nilai metric terendah
sebagai bestpath,berbeda dengan weight kalau di weight nilai metric tertinggi akan di pilih menjadi
bestpath.
Konfigurasi EIGRP dan BGP di R1
router eigrp 10
network 1.1.1.1 0.0.0.0
network 12.12.12.0 0.0.0.255
!
router bgp 100
bgp log-neighbor-changes
network 11.11.11.11 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
!
Konfigurasi EIGRP dan BGP di R2
router eigrp 10
network 2.2.2.2 0.0.0.0
network 12.12.12.0 0.0.0.255
network 23.23.23.0 0.0.0.255
network 25.25.25.0 0.0.0.255
!
router bgp 100
bgp log-neighbor-changes
network 22.22.22.22 mask 255.255.255.255
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source Loopback0
neighbor 1.1.1.1 route-reflector-client
neighbor 1.1.1.1 next-hop-self
neighbor 5.5.5.5 remote-as 100
neighbor 5.5.5.5 update-source Loopback0
neighbor 5.5.5.5 route-reflector-client
neighbor 5.5.5.5 next-hop-self
neighbor 23.23.23.2 remote-as 200
neighbor 23.23.23.2 next-hop-self
!
Konfigurasi EIGRP dan BGP di R3
router eigrp 10
network 3.3.3.3 0.0.0.0
network 23.23.23.0 0.0.0.255
network 34.34.34.0 0.0.0.255
network 36.36.36.0 0.0.0.255
!
router bgp 200
bgp log-neighbor-changes
network 33.33.33.33 mask 255.255.255.255
neighbor 4.4.4.4 remote-as 200
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 route-reflector-client
neighbor 4.4.4.4 next-hop-self
neighbor 6.6.6.6 remote-as 200
neighbor 6.6.6.6 update-source Loopback0
neighbor 6.6.6.6 route-reflector-client
neighbor 6.6.6.6 next-hop-self
neighbor 23.23.23.1 remote-as 100
neighbor 23.23.23.1 next-hop-self
neighbor 23.23.23.1 route-map MED out
neighbor 36.36.36.2 remote-as 200
!
Konfigurasi Route Map dan setting valuenya di R3
route-map MED permit 10
set metric 200
Konfigurasi EIGRP dan BGP di R4
router eigrp 10
network 4.4.4.4 0.0.0.0
network 34.34.34.0 0.0.0.255
!
router bgp 200
bgp log-neighbor-changes
network 44.44.44.44 mask 255.255.255.255
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 update-source Loopback0
!
Konfigurasi EIGRP dan BGP di R5
router eigrp 10
network 5.5.5.5 0.0.0.0
network 25.25.25.0 0.0.0.255
network 56.56.56.0 0.0.0.255
!
router bgp 100
bgp log-neighbor-changes
network 55.55.55.55 mask 255.255.255.255
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 56.56.56.2 remote-as 200
neighbor 56.56.56.2 next-hop-self
!
Konfigurasi EIGRP dan BGP di R6
router eigrp 10
network 6.6.6.6 0.0.0.0
network 36.36.36.0 0.0.0.255
network 56.56.56.0 0.0.0.255
!
router bgp 200
bgp log-neighbor-changes
network 66.66.66.66 mask 255.255.255.255
neighbor 3.3.3.3 remote-as 200
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 56.56.56.1 remote-as 100
neighbor 56.56.56.1 next-hop-self
!
verifikasi sebelum menggunakan attribute MED
R1#sh ip bgp
BGP table version is 36, local router ID is 11.11.11.11
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
*>i 22.22.22.22/32 2.2.2.2 0 100 0 i
*>i 33.33.33.33/32 2.2.2.2 0 100 0 200 i
*>i 44.44.44.44/32 2.2.2.2 0 100 0 200 i
*>i 55.55.55.55/32 5.5.5.5 0 100 0 i
*>i 66.66.66.66/32 2.2.2.2 0 100 0 200 i
R1#trace 44.44.44.44
Type escape sequence to abort.
Tracing the route to 44.44.44.44
VRF info: (vrf in name/id, vrf out name/id)
1 12.12.12.2 7 msec 5 msec 6 msec
2 23.23.23.2 1 msec 1 msec 6 msec
3 34.34.34.2 3 msec 6 msec 2 msec
Terlihat di BGP table R1 untuk menuju R4 menggunakan jalur next hop R2, ketika
di trace untuk lebih detail dari R1 ke R4 ternyata menggunakan jalur
langsung ke R3 atau R1 > R2 > R3 >R4
Verifikasi di R2 setelah di konfigurasi MED di R3
R2(config)#do sh ip bgp
BGP table version is 39, local router ID is 22.22.22.22
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
*>i 11.11.11.11/32 1.1.1.1 0 100 0 i
*> 22.22.22.22/32 0.0.0.0 0 32768 i
*>i 33.33.33.33/32 5.5.5.5 0 100 0 200 i
* 23.23.23.2 200 0 200 i
*>i 44.44.44.44/32 5.5.5.5 0 100 0 200 i
* 23.23.23.2 200 0 200 i
*>i 55.55.55.55/32 5.5.5.5 0 100 0 i
* 66.66.66.66/32 23.23.23.2 200 0 200 i
*>i 5.5.5.5 0 100 0 200 i
Terlihat pada BGP table di R2 Metric 23.23.23.2 berubah menjadi 200, hal ini
menyebabkan jalur 23.23.23.2 tidak akan di pilih sebagai next-hop untuk
menuju R4, BGP akan memilih metric terkecil, untuk lebih jelasnya kita trace
dari R1 ke R4
R1#trace 44.44.44.44
Type escape sequence to abort.
Tracing the route to 44.44.44.44
VRF info: (vrf in name/id, vrf out name/id)
1 12.12.12.2 6 msec 5 msec 2 msec
2 25.25.25.2 10 msec 10 msec 11 msec
3 56.56.56.2 10 msec 10 msec 9 msec
4 36.36.36.1 9 msec 10 msec 9 msec
5 34.34.34.2 9 msec 6 msec 10 msec
R1#
Dan ketika di trace dari R1 ke R4 BGP memilih R5 dan R6 sebagai next hop
untuk menuju R4, jadi R1 > R2 > R5 > R6 > R3 > R4
Alhamdulillah sampai disini selesei
Salam Ngoprek