Pages

Ngoprek Konfigurasi BGP Router Reflector di Mikrotik

Ayo, lanjut ngoprek lagi...
Lab ini akan melakukan konfigurasi BGP Route Reflector dengan menggunakan tool GNS3. Jadi kita bikin simulasi BGP Route Reflector di Mikrotik dengan topologi seperti berikut :



Tahapan konfigurasi :
  • Set identity di masing-masing router
  • Konfigurasi IP Address di setiap router
  • Set BGP Instance di setiap router. Ada 2 ASN berbeda yaitu, R2-R3-R4 AS 234 dan R1 AS 100.
  • Add BGP Peer. Disini konfigurasi peering BGP Mikrotik nya R2 dan R3 peering eBGP ke R1 dan peering iBGP ke R4. Di iBGP semua router harus established peering satu sama lain (mesh), supaya saling melengkapi tabel routing BGP. Tapi, bisa diakalin pake Route Reflector (RR), gunanya kalo udah banyak router yang iBGP, maka harus peering satu-satu ke semua router di AS yang sama. Kalo pake RR, salah satu dari router di iBGP ibaratnya dijadiin patokan. Bisa satu router dijadiin RR, atau bisa 2, tergantung kebutuhan.

Lanjut ke konfigurasi, pertama yang di konfig R1. Tapi bebas sih mau yang mana duluan.

Set identity router Mikrotik R1
[admin@MikroTik] > sys id set name=R-1
[admin@R-1] >
Konfigurasi IP Address di router Mikrotik R1
[admin@R-1] > /ip address
add address=10.10.10.1/24 interface=ether2 network=10.10.10.0
add address=20.20.20.1/24 interface=ether3 network=20.20.20.0 
Set BGP instance di router Mikrotik R1
[admin@R-1] > /routing bgp instance set default as=100 
Konfigurasi eBGP peering di Mikrotik R1
[admin@R-1] >  /routing bgp peer
add name=peer-to-R2 remote-address=10.10.10.2 remote-as=234
add name=peer-to-R2 remote-address=20.20.20.2 remote-as=234


Setelah R1, lalu R2 di konfig. Tahapan nya sama seperti konfigurasi R1
[admin@Mikrotik] > /system identity set name=R-2
[admin@R-2] >
 
[admin@R-2] > /ip address
add address=10.10.10.2/24 interface=ether2 network=10.10.10.0
add address=30.30.30.1/24 interface=ether3 network=30.30.30.0
 
[admin@R-2] > /routing bgp instance set default as=234 
[admin@R-2] > /routing bgp peer
add name=peer-to-R1 remote-address=10.10.10.1 remote-as=100
add name=peer-to-R4 nexthop-choice=force-self remote-address=30.30.30.2 remote-as=234

Selesai konfig R2, lanjut ke R3. Tahapan juga mostly persis sama R2.
[admin@Mikrotik] > /system identityset name=R-3
[admin@R-3] >
 
[admin@R-3] > /ip address
add address=20.20.20.2/24 interface=ether2 network=20.20.20.0
add address=40.40.40.1/24 interface=ether3 network=40.40.40.0
 
[admin@R-3] > /routing bgp instance set default as=234 
[admin@R-3] > /routing bgp peer
add name=peer-to-R1 remote-address=20.20.20.1 remote-as=100
add name=peer-to-R4 nexthop-choice=force-self remote-address=40.40.40.1 remote-as=234

Last konfig, di R4. Tahapannya juga sama seperti R2 dan R3.

[admin@Mikrotik] > /system identity set name=R-4
[admin@R-4] > 
[admin@R-4] > /ip address add address=30.30.30.2/24 interface=ether3 network=30.30.30.0
add address=40.40.40.2/24 interface=ether2 network=40.40.40.0
add address=192.168.0.1/24 interface=ether4 network=192.168.0.0
add address=192.168.1.1/24 interface=ether5 network=192.168.1.0 
[admin@R-4] > /routing bgp instance set default as=234 
[admin@R-4] > /routing bgp peer
add name=peer-to-R2 remote-address=30.30.30.1 remote-as=234 route-reflect=yes
add name=peer-to-R2 remote-address=40.40.40.1 remote-as=234 route-reflect=yes

Oke, sekarang kita cek apakah konfigurasi sudah berjalan normal atau belum.

[admin@R-1] > routing bgp peer print status
Flags: X - disabled, E - established
 0 E name="peer-to-R2" instance=default remote-address=10.10.10.2 remote-as=234 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
     remote-id=10.10.10.2 local-address=10.10.10.1 uptime=21m52s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

 1 E name="peer-to-R2" instance=default remote-address=20.20.20.2 remote-as=234 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
     remote-id=20.20.20.2 local-address=20.20.20.1 uptime=17m17s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

[admin@R-2] > routing bgp peer print status
Flags: X - disabled, E - established
 0 E name="peer-to-R1" instance=default remote-address=10.10.10.1 remote-as=100 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
     remote-id=10.10.10.1 local-address=10.10.10.2 uptime=23m23s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

 1 E name="peer-to-R4" instance=default remote-address=30.30.30.2 remote-as=234 tcp-md5-key=""
     nexthop-choice=force-self 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
     remote-id=30.30.30.2 local-address=30.30.30.1 uptime=5m26s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

[admin@R-3] > routing bgp peer print status
Flags: X - disabled, E - established
 0 E name="peer-to-R1" instance=default remote-address=20.20.20.1 remote-as=100 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
     remote-id=10.10.10.1 local-address=20.20.20.2 uptime=23m49s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

 1 E name="peer-to-R4" instance=default remote-address=40.40.40.2 remote-as=234 tcp-md5-key=""
     nexthop-choice=force-self 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
     remote-id=30.30.30.2 local-address=40.40.40.1 uptime=1m28s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

[admin@R-4] > routing bgp peer print status
Flags: X - disabled, E - established
 0 E name="peer-to-R2" instance=default remote-address=30.30.30.1 remote-as=234 tcp-md5-key=""
     nexthop-choice=default multihop=no route-reflect=yes 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
     remote-id=10.10.10.2 local-address=30.30.30.2 uptime=11m42s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

 1 E name="peer-to-R2" instance=default remote-address=40.40.40.1 remote-as=234 tcp-md5-key=""
     nexthop-choice=default multihop=no route-reflect=yes 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
     remote-id=20.20.20.2 local-address=40.40.40.2 uptime=2m43s prefix-count=0 updates-sent=0
     updates-received=0 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m used-hold-time=3m
     used-keepalive-time=1m refresh-capability=yes as4-capability=yes state=established

Semua sudah terkoneksi dengan baik. Bila sudah seperti yang diharapkan, sekarang perlu adanya advertise network supaya bisa dicek, tabel routing yang beredar di masing-masing router. Advertise network saat ini hanya dilakukan di router R4. 

Berikut konfigurasi advertise network BGP pada Mikrotik R4.
[admin@R-4] > /routing bgp network
add network=192.168.0.0/24
add network=192.168.1.0/24
Cek di masing-masing router tabel routingnya.

[admin@R-1] > ip route print detail
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 ADC  dst-address=10.10.10.0/24 pref-src=10.10.10.1 gateway=ether2 gateway-status=ether2 reachable
        distance=0 scope=10

 1 ADC  dst-address=20.20.20.0/24 pref-src=20.20.20.1 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10

 2 ADb  dst-address=192.168.0.0/24 gateway=10.10.10.2 gateway-status=10.10.10.2 reachable via  ether2
        distance=20 scope=40 target-scope=10 bgp-as-path="234" bgp-origin=igp received-from=peer-to-R2

 3  Db  dst-address=192.168.0.0/24 gateway=20.20.20.2 gateway-status=20.20.20.2 reachable via  ether3
        distance=20 scope=40 target-scope=10 bgp-as-path="234" bgp-origin=igp received-from=peer-to-R2

 4 ADb  dst-address=192.168.1.0/24 gateway=10.10.10.2 gateway-status=10.10.10.2 reachable via  ether2
        distance=20 scope=40 target-scope=10 bgp-as-path="234" bgp-origin=igp received-from=peer-to-R2

 5  Db  dst-address=192.168.1.0/24 gateway=20.20.20.2 gateway-status=20.20.20.2 reachable via  ether3
        distance=20 scope=40 target-scope=10 bgp-as-path="234" bgp-origin=igp received-from=peer-to-R2



[admin@R-2] > ip route  print  detail
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 ADC  dst-address=10.10.10.0/24 pref-src=10.10.10.2 gateway=ether2 gateway-status=ether2 reachable
        distance=0 scope=10

 1 ADC  dst-address=30.30.30.0/24 pref-src=30.30.30.1 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10

 2 ADb  dst-address=192.168.0.0/24 gateway=30.30.30.2 gateway-status=30.30.30.2 reachable via  ether3
        distance=200 scope=40 target-scope=30 bgp-local-pref=100 bgp-origin=igp received-from=peer-to-R4

 3 ADb  dst-address=192.168.1.0/24 gateway=30.30.30.2 gateway-status=30.30.30.2 reachable via  ether3
        distance=200 scope=40 target-scope=30 bgp-local-pref=100 bgp-origin=igp received-from=peer-to-R4


[admin@R-3] > ip route print detail
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 ADC  dst-address=20.20.20.0/24 pref-src=20.20.20.2 gateway=ether2 gateway-status=ether2 reachable
        distance=0 scope=10

 1 ADC  dst-address=40.40.40.0/24 pref-src=40.40.40.1 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10

 2 ADb  dst-address=192.168.0.0/24 gateway=40.40.40.2 gateway-status=40.40.40.2 reachable via  ether3
        distance=200 scope=40 target-scope=30 bgp-local-pref=100 bgp-origin=igp received-from=peer-to-R4

 3 ADb  dst-address=192.168.1.0/24 gateway=40.40.40.2 gateway-status=40.40.40.2 reachable via  ether3
        distance=200 scope=40 target-scope=30 bgp-local-pref=100 bgp-origin=igp received-from=peer-to-R4


Selesai.. Semoga bermanfaat. :)

1 comment

 

Most Reading