Jumat, 12 September 2014

Lap 7 BGP Multihoming-Load Balancing(1 ISP)

Lap 7 BGP Multihoming-Load Balancing(1 ISP)

Overview:
  •  By default BGP route hanya menggunakan 1 jalur saja. Untu menggunkan 2 jalur secra bersamaan (load balancing), kalau dalam sisco bisa menggunakan parameter “max path” yang bisa di set dengna jumlah 1-16.
  • Bedanya di mikrotik tidak support untuk max path, karena by default BGP di mikrotik menggukan multipath. Kita dapat menggunakan teknik ECMP atau routing filter.

Tujuan Lap:
  • Mempelajari BGP load balancing
  • Mempelajari implementasi ECMP dan routing filter

Topologi Lap:
  • Nyalakan kembali(enablekan) interface di R1 yang kita matikan tadi

-         

-         

Config R1

[admin@MikroTik] > /system identity
set name=R1
[admin@R1] > /ip address
add address=13.13.13.1/24 interface=ether2
add address=12.12.12.1/24 interface=ether1
add address=14.14.14.1/24 interface=ether3
[admin@R1] > /routing bgp instance
set default as=130 redistribute-connected=yes
[admin@R1] > /routing bgp peer
add name=peer1 remote-address=12.12.12.2 remote-as=65500
add name=peer2 remote-address=13.13.13.3 remote-as=130 nexthop-choice=force-self
add name=peer3 remote-address=14.14.14.4 remote-as=400

Config R2

[admin@MikroTik] > /system identity
set name=R2
[admin@R2] > /interface bridge
add name=bridge1
[admin@R2] > /ip address
add address=12.12.12.2/24 interface=ether1
add address=23.23.23.2/24 interface=ether2
add address=2.2.2.2/32 interface=bridge1
[admin@R2] > /routing bgp instance
set default as=65500 redistribute-connected=yes
[admin@R2] > /routing bgp peer
add name=peer1 out-filter=med150-out remote-address=12.12.12.1 remote-as=130
add name=peer2 out-filter=med100-out remote-address=23.23.23.3 remote-as=130

Config R3

[admin@R3] > /system identity
set name=R3
[admin@R3] > /routing bgp instance
set default as=130 redistribute-connected=yes
[admin@R3] > /ip address
add address=13.13.13.3/24 interface=ether2
add address=23.23.23.3/24 interface=ether1
add address=34.34.34.3/24 interface=ether3
[admin@R3] > /routing bgp peer
add name=peer1 remote-address=13.13.13.1 remote-as=130 nexthop-choice=force-self
add name=peer2 remote-address=23.23.23.2 remote-as=65500
add name=peer3 remote-address=34.34.34.4 remote-as=400
[admin@R3] > /routing bgp instance
set default as=130 redistribute-connected=yes

Config R4

[admin@R4] > /system identity
set name=R4
[admin@R4] > /routing bgp instance
set default as=400 redistribute-connected=yes
[admin@R4] > /ip address
add address=14.14.14.4/24 interface=ether1
add address=34.34.34.4/24 interface=ether2
[admin@R4] > /routing bgp peer
add name=peer1 remote-address=14.14.14.1 remote-as=130
add name=peer2 remote-address=34.34.34.3 remote-as=130

Ceck 1

Routing table R4, untuk network 2.2.2.2/32

[admin@R4] > /ip route print detail where dst-address=2.2.2.2/32
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
 0 ADb  dst-address=2.2.2.2/32 gateway=14.14.14.1 gateway-status=14.14.14.1 reachable via  ether1 distance=20 scope=40 target-scope=10 bgp-as-path="130,65500" bgp-origin=incomplete received-from=peer1
 1  Db  dst-address=2.2.2.2/32 gateway=34.34.34.3 gateway-status=34.34.34.3 reachable via  ether2 distance=20 scope=40 target-scope=10 bgp-as-path="130,65500" bgp-origin=incomplete received-from=peer2
AS Privat 65500 akan muncul di routing tabrl R4, untuk menghilangkannya kita configure BGP peering yang mengadertisenya yaitu di R1 dan R3

Config tambahan di R1

[admin@R1] > /routing bgp peer print detail where remote-as=400
Flags: X - disabled, E - established
 0 E name="peer3" instance=default remote-address=14.14.14.4 remote-as=400 tcp-md5-key="" nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=255 in-filter="" out-filter="" address-families=ip default-originate=never remove-private-as=no as-override=no passive=no use-bfd=no

[admin@R1] > /routing bgp peer
set peer3 remove-private-as=yes

Config tambah di R3

[admin@R3] > /routing bgp peer print detail where remote-as=400
Flags: X - disabled, E - established
 0 E name="peer3" instance=default remote-address=34.34.34.4 remote-as=400 tcp-md5-key="" nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=255 in-filter="" out-filter="" address-families=ip default-originate=never remove-private-as=no as-override=no passive=no use-bfd=no

[admin@R3] > /routing bgp peer
set peer3 remove-privat-as=yes

Ceck R4 unruk 4.4.4.4/32

[admin@R4] > /ip route print detail where dst-address=2.2.2.2/32
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
 0 ADb  dst-address=2.2.2.2/32 gateway=14.14.14.1 gateway-status=14.14.14.1 reachable via  ether1 distance=20 scope=40 target-scope=10 bgp-as-path="130" bgp-origin=incomplete received-from=peer1
 1  Db  dst-address=2.2.2.2/32 gateway=34.34.34.3 gateway-status=34.34.34.3 reachable via  ether2 distance=20 scope=40 target-scope=10 bgp-as-path="130" bgp-origin=incomplete received-from=peer2

Multihoming Redundancy(main-backup)

[admin@R4] > /interface bridge
add name=bridge1
[admin@R4] > /ip address
add address=4.4.4.4/32 interface=bridge1

Cek 1, Trace R2 ke 4.4.4.4/32 dan ceck routing table

[admin@R2] > /tool traceroute 4.4.4.4 src-address=2.2.2.2
 # ADDRESS                                 RT1   RT2   RT3   STATUS
 1 12.12.12.1                              54ms  5ms   6ms
 2 4.4.4.4                                 61ms  5ms   6ms

[admin@R2] > /ip route print detail where dst-address=4.4.4.4/32
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
 0 ADb  dst-address=4.4.4.4/32 gateway=12.12.12.1 gateway-status=12.12.12.1 reachable via  ether1 distance=20 scope=40 target-scope=10 bgp-as-path="130,400" bgp-origin=incomplete received-from=peer1
 1  Db  dst-address=4.4.4.4/32 gateway=23.23.23.3 gateway-status=23.23.23.3 reachable via  ether2 distance=20 scope=40 target-scope=10 bgp-as-path="130,400" bgp-origin=incomplete received-from=peer2

Walaupun menggunkan 2 link upstream, by default BGP hanya menggunkan 1 link active dari router R2(router ISP kita) ternyata traffic upstream dilewatkan R1, sedangkan upstream melewati R3 posisinya inactive atau idle.

Cek apabila link melewati R1 down apakah link backup yang melewati R3 bisa digunakan?

Simulasinya dengan mematikan interface R1 ke R4

[admin@R1] > /ip address print where address="14.14.14.1/24"
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE
 0   14.14.14.1/24      14.14.14.0      ether3

[admin@R1] > /interface disable ether3

Trace dan ping kembali ke 4.4.4.4 dari R2

[admin@R2] > /tool traceroute 4.4.4.4 src-address=2.2.2.2
 # ADDRESS                                 RT1   RT2   RT3   STATUS
 1 12.12.12.1                                   6ms     9ms   3ms
 2 23.23.23.3                                 24ms     5ms   5ms
 3 0.0.0.0                                         0ms     0ms   0ms
 4 0.0.0.0                                         0ms     0ms   0ms
 5 0.0.0.0                                         0ms     0ms   0ms




[admin@R2] > /tool traceroute 4.4.4.4 src-address=2.2.2.2
 # ADDRESS                                 RT1   RT2   RT3   STATUS
 1 12.12.12.1                                  6ms   4ms   4ms
 2 23.23.23.3                                  8ms   5ms   6ms
 3 4.4.4.4                                       12ms  6ms   5ms

BGP Load-Balancing with ECMP(Equal Cost Multiple Path)

Config R2

[admin@R2] > /ip route
add distance=1 dst-address=4.4.4.4/32 gateway=23.23.23.3,12.12.12.1

Ceck

[admin@R2] > /ip route print detail where dst-address=4.4.4.4/32
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 2 A S  dst-address=4.4.4.4/32 gateway=23.23.23.3,12.12.12.1 gateway-status=23.23.23.3 reachable via  ether2,12.12.12.1 reachable via  ether1 distance=1scope=30 target-scope=10
 0  Db  dst-address=4.4.4.4/32 gateway=12.12.12.1 gateway-status=12.12.12.1 reachable via  ether1 distance=20 scope=40 target-scope=10 bgp-as-path="130,400" bgp-origin=incomplete received-from=peer1
 1  Db  dst-address=4.4.4.4/32 gateway=23.23.23.3 gateway-status=23.23.23.3 reachable via  ether2 distance=20 scope=40 target-scope=10 bgp-as-path="130,400" bgp-origin=incomplete received-from=peer2

[admin@R2] > /tool traceroute 4.4.4.4 src-address=2.2.2.2
 # ADDRESS                                 RT1   RT2   RT3   STATUS
 1 23.23.23.3                                   9ms   3ms   3ms
 2 4.4.4.4                                       22ms  15ms  4ms

BGP Load-Balancing with Routing Filter

Walaupun BGP tidak dapat mengoprasikan multiple next-hop(multiple gateway) dalam suatu single route, namun ada cara lain untuk mendapatkan route dengan multiple gateway dalam satu router


Config R2

[admin@R2] > /routing filter
add chain=bgp-in set-in-nexthop=12.12.12.1,23.23.23.3

[admin@R2] > /routing bgp peer
set peer1,peer2 set-in-nexthop=12.12.12.1,23.23.23.3


Cek

[admin@R2] > /ip route print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADC  2.2.2.2/32                 2.2.2.2                bridge1                   0
 1 A S  4.4.4.4/32                                            23.23.23.3                 1
                                                                        12.12.12.1
 2  Db  4.4.4.4/32                                            12.12.12.1               20
                                                                        23.23.23.3              
 3  Db  4.4.4.4/32                                            12.12.12.1               20


  Semua route keluar dari R2 akan memiliki 2 gateway yaitu 12.12.12.1/23.23.23.3

1 komentar:

  1. Gurih Gurih Nyoiiiiiiiii: Lap 7 Bgp Multihoming-Load Balancing(1 Isp) >>>>> Download Now

    >>>>> Download Full

    Gurih Gurih Nyoiiiiiiiii: Lap 7 Bgp Multihoming-Load Balancing(1 Isp) >>>>> Download LINK

    >>>>> Download Now

    Gurih Gurih Nyoiiiiiiiii: Lap 7 Bgp Multihoming-Load Balancing(1 Isp) >>>>> Download Full

    >>>>> Download LINK

    BalasHapus