Konfigurasi BGP Remove Private AS di Mikrotik - Sesuai topologi diatas, antara R1-R2 dan R3 menggunakan Private AS-Number. Private AS-Number dimulai dari 64512 to 65535. Dalam lab diatas mengguankan AS 65000.
Sedangkan Global Unique AS-Number antara 1-64511. Dalam lab ini menggunakan AS 4404, 5505 dan 6606 yang digunakan oleh R4-R5 dan R6.
Tujuannya adalah R6 dapat mengenali network yang diadvertise oleh router yang menggunakan Private AS seperti R1-R2 dan R3, namun R6 akan dibuat tidak mengenali AS-Number yang dipakai oleh router tersebut. Intinya Private AS akan dihapus dari BGP AS-Path menuju router tujuan.
R1-R2 dan R3 peering menggunakan loopback, sedangkan R4-R5 dan R6 menggunakan physical peering. Berikut konfigurasi lengkap dari setiap router.
Konfigurasi R1
/interface bridge
add name=lo0
add name=lo1
/routing bgp instance
set default as=65000 redistribute-connected=yes router-id=1.1.1.1
/routing ospf instance
set [ find default=yes ] router-id=11.11.11.11
/ip address
add address=10.1.1.1/30 interface=ether1 network=10.1.1.0
add address=10.1.1.10/30 interface=ether2 network=10.1.1.8
add address=192.168.1.1/24 interface=lo0 network=192.168.1.0
add address=10.1.1.13/24 interface=ether3 network=10.1.1.0
add address=172.16.10.1 interface=lo1 network=172.16.10.1
/routing bgp network
add network=192.168.1.0/24 synchronize=no
/routing bgp peer
add name=TO-R2 nexthop-choice=force-self remote-address=172.16.10.2 remote-as=\
65000 ttl=default update-source=lo1
add name=TO-R3 nexthop-choice=force-self remote-address=172.16.10.3 remote-as=\
65000 ttl=default update-source=lo1
add name=TO-R4 remote-address=10.1.1.14 remote-as=4404 ttl=default
/routing ospf network
add area=backbone network=10.1.1.0/30
add area=backbone network=10.1.1.8/30
add area=backbone network=172.16.10.1/32
/system identity
set name=R1
Pembahasan lebih detil dibawah ini.
Setelah melakukan konfigurasi IP Address dimasing-masing interface, selanjutnya adalah menghubungkan interface loopback menggunakan OSPF yang akan digunakan untuk peering.
/routing ospf instance
set [ find default=yes ] router-id=11.11.11.11
/routing ospf network
add area=backbone network=10.1.1.0/30
add area=backbone network=10.1.1.8/30
add area=backbone network=172.16.10.1/32
Buat instance OSPF dengan router-id 11.11.11.11 dan advertise network termasuk interface loopbacknya.
/routing bgp instance
set default as=65000 redistribute-connected=yes router-id=1.1.1.1
/routing bgp network
add network=192.168.1.0/24 synchronize=no
/routing bgp peer
add name=TO-R2 nexthop-choice=force-self remote-address=172.16.10.2 remote-as=\
65000 ttl=default update-source=lo1
add name=TO-R3 nexthop-choice=force-self remote-address=172.16.10.3 remote-as=\
65000 ttl=default update-source=lo1
add name=TO-R4 remote-address=10.1.1.14 remote-as=4404 ttl=default
Jika sudah terhubung, baru menuju BGP. Buat instance dengan Private AS yakni 65000. Selanjutnya lakukan peering antar router yang bertetangga. Konfigurasi iBGP antara R1,R2 dan R3 hampir sama, tinggal menyesuaikan topologi diatas.
Konfigurasi R2
/interface bridge
add name=lo0
add name=lo1
/routing bgp instance
set default as=65000 redistribute-connected=yes router-id=2.2.2.2
/routing ospf instance
set [ find default=yes ] router-id=22.22.22.22
/ip address
add address=10.1.1.2/30 interface=ether1 network=10.1.1.0
add address=10.1.1.5/30 interface=ether2 network=10.1.1.4
add address=192.168.2.1/24 interface=lo0 network=192.168.2.0
add address=172.16.10.2 interface=lo1 network=172.16.10.2
/routing bgp network
add network=192.168.2.0/24 synchronize=no
/routing bgp peer
add name=TO-R1 remote-address=172.16.10.1 remote-as=65000 ttl=default update-source=lo1
add name=TO-R3 remote-address=172.16.10.3 remote-as=65000 ttl=default update-source=lo1
/routing ospf network
add area=backbone network=10.1.1.0/30
add area=backbone network=10.1.1.4/30
add area=backbone network=172.16.10.2/32
/system identity
set name=R2
Konfigurasi R3
/interface bridge
add name=lo0
add name=lo1
/routing bgp instance
set default as=65000 redistribute-connected=yes router-id=3.3.3.3
/routing ospf instance
set [ find default=yes ] router-id=33.33.33.33
/ip address
add address=192.168.137.20/24 interface=ether3 network=192.168.137.0
add address=10.1.1.6/30 interface=ether1 network=10.1.1.4
add address=10.1.1.9/30 interface=ether2 network=10.1.1.8
add address=192.168.3.1/24 interface=lo0 network=192.168.3.0
add address=10.1.1.17/30 interface=ether4 network=10.1.1.16
add address=172.16.10.3 interface=lo1 network=172.16.10.3
/routing bgp network
add network=192.168.3.0/24 synchronize=no
/routing bgp peer
add name=TO-R2 nexthop-choice=force-self remote-address=172.16.10.2 remote-as=65000 ttl=default update-source=lo1
add name=TO-R1 nexthop-choice=force-self remote-address=172.16.10.1 remote-as=65000 ttl=default update-source=lo1
add name=TO-R5 remote-address=10.1.1.18 remote-as=5505 remove-private-as=yes ttl=default
/routing ospf network
add area=backbone network=10.1.1.4/30
add area=backbone network=10.1.1.8/30
add area=backbone network=172.16.10.3/32
/system identity
set name=R3
Konfigurasi R4
/interface bridge
add name=lo0
/routing bgp instance
set default as=4404 redistribute-connected=yes router-id=4.4.4.4
/ip address
add address=10.1.1.14/30 interface=ether1 network=10.1.1.12
add address=10.1.1.21/30 interface=ether2 network=10.1.1.20
add address=192.168.4.1/24 interface=lo0 network=192.168.4.0
/routing bgp network
add network=192.168.4.0/24 synchronize=no
/routing bgp peer
add name=TO-R1 remote-address=10.1.1.13 remote-as=65000 ttl=default
add name=TO-R6 remote-address=10.1.1.22 remote-as=6606 ttl=default
/system identity
set name=R4
Konfigurasi R5
/interface bridge
add name=lo0
/routing bgp instance
set default as=5505 redistribute-connected=yes router-id=5.5.5.5
/ip address
add address=10.1.1.25/30 interface=ether2 network=10.1.1.24
add address=10.1.1.18/30 interface=ether1 network=10.1.1.16
add address=192.168.5.1/24 interface=lo0 network=192.168.5.0
/routing bgp network
add network=192.168.5.0/24 synchronize=no
/routing bgp peer
add name=TO-R3 remote-address=10.1.1.17 remote-as=65000 ttl=default
add name=TO-R6 remote-address=10.1.1.26 remote-as=6606 ttl=default
/system identity
set name=R5
Konfigurasi R6
/interface bridge
add name=lo0
/routing bgp instance
set default as=6606 redistribute-connected=yes router-id=6.6.6.6
/ip address
add address=10.1.1.22/30 interface=ether1 network=10.1.1.20
add address=10.1.1.26/30 interface=ether2 network=10.1.1.24
add address=192.168.6.1/24 interface=lo0 network=192.168.6.0
/routing bgp network
add network=192.168.6.0/24 synchronize=no
/routing bgp peer
add name=TO-R4 remote-address=10.1.1.21 remote-as=4404 ttl=default
add name=TO-R5 remote-address=10.1.1.25 remote-as=5505 ttl=default
/system identity
set name=R6
Pengujian
Pengujian dilakukan di R6 dengan melihat routing table. Sebagai contoh, kita akan melihat routing table menuju network yang diadvertise oleh R2 yakni 192.168.2.0/24R6 masih menggunakan private AS-Number. Terlihat disana BGP-AS-PATH nya 5505, 65000. Selanjutnya coba lakukan traceroute.
Untuk ke 192.168.2.0/24, R6 melewati R5 ditandai dengan IP Address 10.1.1.25, kemudian R3 ditandai dengan 10.1.1.17 baru ke 192.168.2.1.
Nah, bagaimana menghilangkan Private AS ini ? Cukup lakukan konfigurasi di R4 dan R5 dengan mencentang remove-private-as=yes pada peering ke R6.
Remove Private di R4
Sehingga konfigurasi lengkapnya seperti dibawah ini.
/interface bridge
add name=lo0
/routing bgp instance
set default as=4404 redistribute-connected=yes router-id=4.4.4.4
/ip address
add address=10.1.1.14/30 interface=ether1 network=10.1.1.12
add address=10.1.1.21/30 interface=ether2 network=10.1.1.20
add address=192.168.4.1/24 interface=lo0 network=192.168.4.0
/routing bgp network
add network=192.168.4.0/24 synchronize=no
/routing bgp peer
add name=TO-R1 remote-address=10.1.1.13 remote-as=65000 ttl=default
add name=TO-R6 remote-address=10.1.1.22 remote-as=6606 remove-private-as=yes ttl=default
/system identity
set name=R4
Remove Private di R5
/interface bridge
add name=lo0
/routing bgp instance
set default as=5505 redistribute-connected=yes router-id=5.5.5.5
/ip address
add address=10.1.1.25/30 interface=ether2 network=10.1.1.24
add address=10.1.1.18/30 interface=ether1 network=10.1.1.16
add address=192.168.5.1/24 interface=lo0 network=192.168.5.0
/ip dhcp-client
add disabled=no interface=ether1
/routing bgp network
add network=192.168.5.0/24 synchronize=no
/routing bgp peer
add name=TO-R3 remote-address=10.1.1.17 remote-as=65000 ttl=default
add name=TO-R6 remote-address=10.1.1.26 remote-as=6606 remove-private-as=yes ttl=default
/system identity
set name=R5
Setelah ditambahkan dengan opsi remove-private-as=yes, kita lihat table routing menuju 192.168.2.0/24Terlihat untuk menuju 192.168.2.0/24 R6 hanya memakai BGP-AS-Path nya 5505. Artinya, Private AS Number berhasil di hapus.
0 comments:
Post a Comment