مقدمه
BGP روی MikroTik RouterOS 7 از موتور مسیریابی کاملاً بازنویسیشدهای استفاده میکند. این راهنما مدل پیکربندی جدید BGP را پوشش میدهد.
تفاوتهای کلیدی در RouterOS 7 BGP
| ویژگی | RouterOS 6 | RouterOS 7 |
|---|---|---|
| نمونه BGP | /routing bgp instance | /routing bgp template |
| پیکربندی Peer | /routing bgp peer | /routing bgp connection |
مرحله ۱: پیکربندی قالب BGP
BASH
/routing bgp template
add name=default as=65001 router-id=10.0.0.1مرحله ۲: افزودن اتصال BGP
BASH
/routing bgp connection
add name=ISP-Peer template=default remote.address=203.0.113.1 remote.as=65000 local.address=203.0.113.2 output.filter-chain=TO-ISP input.filter-chain=FROM-ISPمرحله ۳: فیلترهای مسیر
BASH
/routing filter rule
add chain=TO-ISP rule="if (dst == 192.168.0.0/16) { accept } else { reject }"
add chain=FROM-ISP rule="if (dst == 0.0.0.0/0) { accept } else { reject }"تأیید و رفع عیب
BASH
/routing bgp connection print
/routing bgp session print
/routing route print where bgp
/routing bgp advertisement printراهاندازی Multi-Homing
دو ISP، اولویت ISP1، Failover به ISP2:
BASH
/routing filter rule
add chain=FROM-ISP1 rule="set bgp-local-pref 200; accept"
add chain=FROM-ISP2 rule="set bgp-local-pref 100; accept"