Lab 10, BGP MED
BGP Dual Homing - ISP sama ada dua fitur yaitu
- Main-Backup Mode
- Load Sharing Mode
Konfigurasi dasar
R1
R1(config)#int g1/0
R1(config-if)#ip add 12.12.12.1 255.255.255.0
R1(config-if)#no sh
R1(config)#int g2/0
R1(config-if)#ip add 13.13.13.1 255.255.255.0
R1(config-if)#no sh
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 remote-as 23
R1(config-router)#neighbor 13.13.13.3 remote-as 23
R1(config-router)#net 1.1.1.1 mask 255.255.255.255
R2
R2(config)#int g2/0
R2(config-if)#ip add 12.12.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int f0/0
R2(config-if)#ip add 23.23.23.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int g1/0
R2(config-if)#ip add 24.24.24.2 255.255.255.0
R2(config-if)#no sh
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#router bgp 23
R2(config-router)#neighbor 12.12.12.1 remote-as 1
R2(config-router)#neighbor 23.23.23.3 remote-as 23
R2(config-router)#neighbor 24.24.24.4 remote-as 4
R2(config-router)#net 2.2.2.2 mask 255.255.255.25
R2(config-router)#neighbor 23.23.23.3 next-hop-self
R3
R3(config)#int g1/0
R3(config-if)#ip add 13.13.13.3 255.255.255.0
R3(config-if)#no sh
R3(config)#int f0/0
R3(config-if)#ip add 23.23.23.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#int g2/0
R3(config-if)#ip add 34.34.34.3 255.255.255.0
R3(config-if)#no sh
R3(config)#router bgp 23
R3(config-router)#neighbor 13.13.13.1 remote-as 1
R3(config-router)#neighbor 23.23.23.2 remote-as 23
R3(config-router)#neighbor 34.34.34.4 remote-as 4
R3(config-router)#neighbor 23.23.23.2 next-hop-self
R4
R4(config)#int g1/0
R4(config-if)#ip add 24.24.24.4 255.255.255.0
R4(config-if)#no sh
R4(config)#int g2/0
R4(config-if)#ip add 34.34.34.4 255.255.255.0
R4(config-if)#no sh
R4(config)#int lo0
R4(config-if)#ip add 4.4.4.4 255.255.255.255
R4(config)#router bgp 4
R4(config-router)#neighbor 24.24.24.2 remote-as 23
R4(config-router)#neighbor 34.34.34.3 remote-as 23s
R4(config-router)#net 4.4.4.4 mask 255.255.255.255
kita verifikasi
R1
R1(config)#do show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 2.2.2.2/32 13.13.13.3 0 23 i
*> 12.12.12.2 0 0 23 i
* 4.4.4.4/32 13.13.13.3 0 23 4 i
*> 12.12.12.2 0 23 4 i
Walaupun ada dua link buat mengirim tetapi BGP tetap mengirim lewat 1 link yang dmn link tersebut memiliki bandwith terebesar dan link yang bandwith yang kecil menjadi cadangan atau backup, jadi di sini saya akan mencoba mematikan link yang utama
R1
R1(config)#int g1/0
R1(config-if)#sh
R1
R1(config)#do sh ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 13.13.13.3 0 23 4 i
R1
R1(config)#do show ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 13.13.13.3, 00:03:06
Saat ini linknya sudah berpindah melalui R3. Kemudian, kita tes kembali
dengan cara kita no shutdown pada port yang menuju ke R2.
R1
R1(config)#int g1/0
R1(config-if)#no sh
R1
R1#sh ip bgp
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
* 4.4.4.4/32 12.12.12.2 0 23 4 i
*> 13.13.13.3 0 23 4 i
R1
R1#sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 13.13.13.3, 00:32:17
kita konfigurasikan attribute weight
R1
R1(config)#route-map WEIGHT
R1(config-route-map)#set weight 100
R1(config-route-map)#ex
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 route-map WEIGHT in
R1(config-router)#ex
R1(config)#do clear ip bgp *
R1
R1#sh ip bgp
BGP table version is 3, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 12.12.12.2 100 23 4 i
* 13.13.13.3 0 23 4 i
R1
R1#sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 12.12.12.2, 00:02:09
kita tes lagi shutdown interface ke R2.
R1
R1(config)#int g1/0
R1(config-if)#sh
R1
R1(config)#do sh ip bgp
BGP table version is 4, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0 0 32768 i
*> 4.4.4.4/32 13.13.13.3 0 23 4 i
R1
R1(config)#do sh ip route bgp
4.0.0.0/32 is subnetted, 1 subnets
B 4.4.4.4 [20/0] via 12.12.12.2, 00:00:02
kita juga bisa mengatur trafik yang dating dengan menggunakan (MED)
R1
R1(config)#router bgp 1
R1(config-router)#ip access-list standard LAN
R1(config-std-nacl)#permit 1.1.1.1
R1(config-std-nacl)#route-map R2MED permit 10
R1(config-route-map)#match ip address LAN
R1(config-route-map)#set metric 110
R1(config)#router bgp 1
R1(config-router)#neighbor 12.12.12.2 route-map R2MED out
R1(config-router)#neighbor 13.13.13.3 route-map R3MED out
verifikasi
R3
R3#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
Known via "bgp 23", distance 20, metric 100
Tag 1, type external
Last update from 13.13.13.1 00:00:10 ago
Routing Descriptor Blocks:
* 13.13.13.1, from 13.13.13.1, 00:00:10 ago
Route metric is 100, traffic share count is 1
AS Hops 1
Route tag 1
R2
R2(config)#do show ip bgp 1.1.1.1
BGP routing table entry for 1.1.1.1/32, version 23
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
3
1
23.23.23.3 from 23.23.23.3 (34.34.34.3)
Origin IGP, metric 100, localpref 100, valid, internal, best
1
12.12.12.1 from 12.12.12.1 (1.1.1.1)
Origin IGP, metric 110, localpref 100, valid, external
R2
R2(config)#do show ip bgp
BGP table version is 24, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.1/32 23.23.23.3 100 100 0 1 i
* 12.12.12.1 110 0 1 i
*> 2.2.2.2/32 0.0.0.0 0 32768 i
* i4.4.4.4/32 23.23.23.3 0 100 0 4 i
*> 24.24.24.4 0 0 4 i
R2
R2#traceroute 1.1.1.1 source 2.2.2.2
Type escape sequence to abort.
Tracing the route to 1.1.1.1
1 23.23.23.3 20 msec 20 msec 8 msec
2 13.13.13.1 28 msec 24 msec 8 msec
Komenta