Pages

Ngoprek Konfigurasi BGP Peering Multihop di Mikrotik

Masih kuat ngelab... lanjut..
Lab ini akan melakukan konfigurasi BGP Peering Multihop dengan menggunakan tool GNS3. Jadi kita bikin simulasi BGP Peering Multihop dengan topologi berikut :



Tahapan Konfigurasi :
  • Set Identity di setiap router
  • Add IP Address di setiap router
  • Set BGP Instance di setiap router
  • Add eBGP Peer dari R1-R2, tapi R3 langsung eBGP peering ke R1. Ini bisa, karena BGP ga harus peering pake physical connected. Case ini antara R1 ama R3 mesti punya tabel routing supaya bisa saling ngeping dulu. Boleh pake routingan IGP atau Static..


Dimulai dari konfigurasi R1 identy nya
[admin@Mikrotik] > /system identity set name=R-1
[admin@R-1] > 
Konfigurasi IP Address R1
[admin@R-1] > /ip address
add address=10.10.10.1/24 interface=ether4 network=10.10.10.0
add address=192.168.0.0/24 interface=ether2 network=192.168.0.0
add address=192.168.1.0/24 interface=ether3 network=192.168.1.0 
Konfigurasi Instance BGP pada R1
[admin@R-1] > /routing bgp instance set default as=100 
Konfigurasi peering eBGP R1 ke R2
[admin@R-1] > /routing bgp peer add name=peer-to-R2 remote-address=10.10.10.2 remote-as=200
Konfigurasi peering eBGP R1 ke R3
[admin@R-1] > /routing bgp peer add multihop=yes name=peer-to-R3 remote-address=20.20.20.3 remote-as=300


Lanjut konfig ke R2, tahapannya sama dengan 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=ether4 network=10.10.10.0
add address=192.168.2.0/24 interface=ether3 network=192.168.2.0
add address=192.168.3.0/24 interface=ether2 network=192.168.3.0
add address=20.20.20.1/24 interface=ether5 network=20.20.20.0 
[admin@R-2] > /routing bgp instance set default as=200 
[admin@R-2] > /routing bgp peer add name=peer-to-R1 remote-address=10.10.10.1 remote-as=100
Abis R2, lanjut ke R3. Tahapan mostly sama kayak R1 R2. Tapi bedanya R3 eBGP peering langsung ke R1, punya tabel routing 10.10.10.0/24 biar bisa ngeping ke R1 dan peering eBGP.

[admin@Mikrotik] >/system identity set name=R-3
[admin@R-3] > 
[admin@R-3] > /ip address
add address=20.20.20.3/24 interface=ether2 network=20.20.20.0
add address=192.168.4.0/24 interface=ether4 network=192.168.4.0
add address=192.168.5.0/24 interface=ether3 network=192.168.5.0 
[admin@R-3] >  /ip route add distance=1 dst-address=10.10.10.0/24 gateway=20.20.20.1 
[admin@R-3] >  /routing bgp peer add multihop=yes name=peer-to-R1 remote-address=10.10.10.1 remote-as=100

Konfigurasi almost done nih, sekarang coba cek buat pastiin konfigurasinya.

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=200 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=192.168.3.0 local-address=10.10.10.1 uptime=50m52s prefix-count=2 updates-sent=2
     updates-received=2 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-R3" instance=default remote-address=20.20.20.3 remote-as=300 tcp-md5-key=""
     nexthop-choice=default multihop=yes 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.3 local-address=10.10.10.1 uptime=3m23s prefix-count=0 updates-sent=4
     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=192.168.0.0 local-address=10.10.10.2 uptime=51m18s prefix-count=2 updates-sent=2
     updates-received=2 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=10.10.10.1 remote-as=100 tcp-md5-key=""
     nexthop-choice=default multihop=yes 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=192.168.0.0 local-address=20.20.20.3 uptime=4m3s prefix-count=4 updates-sent=0
     updates-received=4 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

Oke, sudah established semua. Tinggal advertise network di masing-masing router.

[admin@R-1] /routing bgp networkadd network=192.168.0.0/24add network=192.168.1.0/24
[admin@R-2] /routing bgp networkadd network=192.168.2.0/24add network=192.168.3.0/24
[admin@R-3] /routing bgp networkadd network=192.168.4.0/24add network=192.168.5.0/24
Cek lagi apa setiap router terima update prefix yang sudah di advertise setiap router.

[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=ether4 gateway-status=ether4 reachable
        distance=0 scope=10

 1 A S  dst-address=20.20.20.0/24 gateway=10.10.10.2 gateway-status=10.10.10.2 reachable via  ether4
        distance=1 scope=30 target-scope=10

 2 ADC  dst-address=192.168.0.0/24 pref-src=192.168.0.0 gateway=ether2 gateway-status=ether2 reachable
        distance=0 scope=10

 3 ADC  dst-address=192.168.1.0/24 pref-src=192.168.1.0 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10

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

 5 ADb  dst-address=192.168.3.0/24 gateway=10.10.10.2 gateway-status=10.10.10.2 reachable via  ether4
        distance=20 scope=40 target-scope=10 bgp-as-path="200" bgp-origin=igp received-from=peer-to-R2

 6 ADb  dst-address=192.168.4.0/24 gateway=20.20.20.3
        gateway-status=20.20.20.3 recursive via 10.10.10.2 ether4 distance=20 scope=40 target-scope=30
        bgp-as-path="300" bgp-origin=igp received-from=peer1

 7 ADb  dst-address=192.168.5.0/24 gateway=20.20.20.3
        gateway-status=20.20.20.3 recursive via 10.10.10.2 ether4 distance=20 scope=40 target-scope=30
        bgp-as-path="300" bgp-origin=igp received-from=peer1



[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=ether4 gateway-status=ether4 reachable
        distance=0 scope=10

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

 2 ADb  dst-address=192.168.0.0/24 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable via  ether4
        distance=20 scope=40 target-scope=10 bgp-as-path="100" bgp-origin=igp received-from=peer1

 3 ADb  dst-address=192.168.1.0/24 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable via  ether4
        distance=20 scope=40 target-scope=10 bgp-as-path="100" bgp-origin=igp received-from=peer1

 4 ADC  dst-address=192.168.2.0/24 pref-src=192.168.2.0 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10

 5 ADC  dst-address=192.168.3.0/24 pref-src=192.168.3.0 gateway=ether2 gateway-status=ether2 reachable
        distance=0 scope=10

 6 ADb  dst-address=192.168.4.0/24 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable via  ether4
        distance=20 scope=40 target-scope=10 bgp-as-path="100,300" bgp-origin=igp received-from=peer1

 7 ADb  dst-address=192.168.5.0/24 gateway=10.10.10.1 gateway-status=10.10.10.1 reachable via  ether4
        distance=20 scope=40 target-scope=10 bgp-as-path="100,300" bgp-origin=igp received-from=peer1



[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 A S  dst-address=10.10.10.0/24 gateway=20.20.20.1 gateway-status=20.20.20.1 reachable via  ether2
        distance=1 scope=30 target-scope=10

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

 2 ADb  dst-address=192.168.0.0/24 gateway=10.10.10.1
        gateway-status=10.10.10.1 recursive via 20.20.20.1 ether2 distance=20 scope=40 target-scope=30
        bgp-as-path="100" bgp-origin=igp received-from=peer-to-R1

 3 ADb  dst-address=192.168.1.0/24 gateway=10.10.10.1
        gateway-status=10.10.10.1 recursive via 20.20.20.1 ether2 distance=20 scope=40 target-scope=30
        bgp-as-path="100" bgp-origin=igp received-from=peer-to-R1

 4 ADb  dst-address=192.168.2.0/24 gateway=10.10.10.1
        gateway-status=10.10.10.1 recursive via 20.20.20.1 ether2 distance=20 scope=40 target-scope=30
        bgp-as-path="100,200" bgp-origin=igp received-from=peer-to-R1

 5 ADb  dst-address=192.168.3.0/24 gateway=10.10.10.1
        gateway-status=10.10.10.1 recursive via 20.20.20.1 ether2 distance=20 scope=40 target-scope=30
        bgp-as-path="100,200" bgp-origin=igp received-from=peer-to-R1

 6 ADC  dst-address=192.168.4.0/24 pref-src=192.168.4.0 gateway=ether4 gateway-status=ether4 reachable
        distance=0 scope=10

 7 ADC  dst-address=192.168.5.0/24 pref-src=192.168.5.0 gateway=ether3 gateway-status=ether3 reachable
        distance=0 scope=10


Selesai.. semoga bermanfaat. :)

2 comments

 

Most Reading