BGP: الـ Route Reflector بدل الـ Full Mesh
قاعدة الـ iBGP split horizon تفرض full mesh، وهذا ما يكبر. الـ route reflector راوتر مسموح له يعيد إعلان مسارات iBGP لعملائه. نشوف المشكلة، ونطبّق route-reflector-client، ونفهم قواعد الانعكاس بين client و non-client، ونقرا الـ originator والـ cluster list اللي تمنع الـ loops.
ضمن مسار ENARSI 300-410 — التوجيه المتقدم وخدمات الشبكات
شرح الدرس مكتوبًا
نص شرح المعلم والكود الذي كتبه ونتيجة تشغيله، بنفس ترتيب الدرس.
enable
configure terminal
hostname R1
no ip domain-lookup
interface g0/0/0
ip address 10.0.12.1 255.255.255.0
no shutdown
interface lo0
ip address 1.1.1.1 255.255.255.255
interface lo1
ip address 172.16.1.1 255.255.255.0
ip ospf network point-to-point
end
enable
configure terminal
router ospf 1
router-id 1.1.1.1
network 10.0.12.0 0.0.0.255 area 0
network 1.1.1.1 0.0.0.0 area 0
end
enable
configure terminal
router bgp 65000
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 65000
neighbor 2.2.2.2 update-source lo0
network 172.16.1.0 mask 255.255.255.0
endenable
configure terminal
hostname R2
no ip domain-lookup
interface g0/0/0
ip address 10.0.12.2 255.255.255.0
no shutdown
interface g0/0/1
ip address 10.0.23.2 255.255.255.0
no shutdown
interface lo0
ip address 2.2.2.2 255.255.255.255
interface lo1
ip address 172.16.2.1 255.255.255.0
ip ospf network point-to-point
end
enable
configure terminal
router ospf 1
router-id 2.2.2.2
network 10.0.12.0 0.0.0.255 area 0
network 10.0.23.0 0.0.0.255 area 0
network 2.2.2.2 0.0.0.0 area 0
end
enable
configure terminal
router bgp 65000
bgp router-id 2.2.2.2
neighbor 1.1.1.1 remote-as 65000
neighbor 1.1.1.1 update-source lo0
neighbor 3.3.3.3 remote-as 65000
neighbor 3.3.3.3 update-source lo0
network 172.16.2.0 mask 255.255.255.0
endenable
configure terminal
hostname R3
no ip domain-lookup
interface g0/0/0
ip address 10.0.23.3 255.255.255.0
no shutdown
interface lo0
ip address 3.3.3.3 255.255.255.255
interface lo1
ip address 172.16.3.1 255.255.255.0
ip ospf network point-to-point
end
enable
configure terminal
router ospf 1
router-id 3.3.3.3
network 10.0.23.0 0.0.0.255 area 0
network 3.3.3.3 0.0.0.0 area 0
end
enable
configure terminal
router bgp 65000
bgp router-id 3.3.3.3
neighbor 2.2.2.2 remote-as 65000
neighbor 2.2.2.2 update-source lo0
network 172.16.3.0 mask 255.255.255.0
endحيّاك الله. في درس الـ iBGP قلنا: مسار من جار iBGP ما ينعلن لجار iBGP ثاني. والنتيجة full mesh: عشرة راوترات يعني خمسة وأربعين جلسة، ومِيّة راوتر يعني قريب خمس آلاف. المعمل: ثلاث راوترات في AS six five zero zero zero، و R2 في النص عنده جلسة مع R1 ومع R3، وما فيه جلسة بين R1 و R3. نشوف R3 يعرف شبكة R1 أو لا.
show ip bgpR3 يعرف one seventy two dot sixteen dot two dot zero من R2 بس. وشبكة R1 ما وصلت. لأن R2 تعلّمها من R1 بـ iBGP، والقاعدة تمنعه يعطيها لـ R3. الحل: نخلي R2 route reflector. يعني نسمح له يكسر القاعدة، لكن بشروط تمنع الـ loops.
الـ route reflector يقسم جيرانه الـ iBGP لنوعين: clients و non-clients. والقواعد: مسار من client: ينعكس للكل، clients و non-clients. مسار من non-client: ينعكس للـ clients بس. ومسار من eBGP: ينعلن للكل عادي. والإعداد على الـ reflector بس. الـ client ما يدري إنه client، وما يحتاج أي تغيير. نخلي R1 client، و R3 نتركه non-client، ونشوف القواعد بعيننا.
configure terminal
router bgp 65000
neighbor 1.1.1.1 route-reflector-client
endshow ip bgpshow ip bgpالحين R3 يعرف one seventy two dot sixteen dot one dot zero، و R1 يعرف one seventy two dot sixteen dot three dot zero. الأول: مسار من client، يعني R1، انعكس لـ non-client، يعني R3. والثاني: مسار من non-client، يعني R3، انعكس لـ client، يعني R1. يعني client واحد كفى هنا. لكن لو عندك non-client ين، المسارات بينهم ما تنعكس. ولاحظ الـ next hop في R3: one dot one dot one dot one، يعني الـ reflector ما غيّره. وكيف الـ reflector يمنع الـ loops، والـ AS path ما يتغير؟ بـ attribute ين جديدين. ORIGINATOR_ID: الـ router ID حق اللي أعلن المسار أول مرّة داخل الـ AS. لو رجع له المسار، يرميه. و CLUSTER_LIST: كل reflector يمر عليه المسار يضيف الـ cluster ID حقه. لو reflector شاف الـ ID حقه في القائمة، يرمي المسار. نشوفهم في R3.
show ip bgp 172.16.1.0Originator: one dot one dot one dot one، يعني R1. و Cluster list: two dot two dot two dot two، والـ cluster ID افتراضياً هو الـ router ID حق الـ reflector. الحين دورك. لما يكون عندك reflector ين للـ redundancy، تعطيهم نفس الـ cluster ID. غيّر الـ cluster ID في R2 لـ ten dot ten dot ten dot ten، وتأكد إن R3 يشوف الرقم الجديد في الـ cluster list. وقّف الفيديو، وجرّب.
تمرين: على R2: router bgp 65000 ← bgp cluster-id 10.10.10.10. بعدها على R3: show ip bgp 172.16.1.0.
الحل.
configure terminal
router bgp 65000
bgp cluster-id 10.10.10.10
end
clear ip bgp * softshow ip bgp 172.16.1.0الـ cluster list صار ten dot ten dot ten dot ten. واستخدمنا clear ip bgp star soft، عشان R2 يعيد إعلان المسارات بالـ attributes الجديدة، بدون ما يقطع الجلسات. الخلاصة: الـ route reflector يكسر الـ full mesh، بقواعد client و non-client، والـ originator والـ cluster list يمنعون الـ loops. والدرس الجاي: كيف BGP يختار أفضل مسار.
دروس المسار (74)
- حيّاكم الله: من ENCOR إلى ENARSI
- كيف يختار الراوتر المسار: Longest Match و Administrative Distance
- الـ Prefix List: فلترة بالشبكة وبطول الـ prefix
- الـ Route Map: لغة السياسات في التوجيه
- الـ Distribute List: الفلترة في EIGRP وفي OSPF
- الـ Redistribution: ربط EIGRP مع OSPF
- مشاكل الـ Redistribution في أكثر من نقطة: Tags تمنع الـ Loop
- الـ Summarization: مسار واحد بدل أربعة، و Null0
- منع الـ Loops: Split Horizon و Route Poisoning
- الـ Policy Based Routing: توجيه حسب المصدر
- الـ VRF-Lite: أكثر من Routing Table في راوتر واحد
- الـ BFD: اكتشاف العطل في جزء من الثانية
- تشخيص أعطال التوجيه: طريقة منظمة على شبكة خربانة
- EIGRP: شروط الجيرة وتشخيص الجار اللي ما يطلع
- EIGRP: الـ Metric بالأرقام، وكيف تتحكم في المسار
- EIGRP: الـ DUAL و الـ Feasible Successor
- EIGRP Named Mode: كل الإعدادات في مكان واحد
- EIGRP: الـ Variance و Unequal-Cost Load Balancing
- EIGRP Stub: حماية الشبكة من الـ Queries
- EIGRP: الـ Leak-Map والـ Offset-List
- EIGRP: الـ Authentication بـ MD5 و SHA-256
- EIGRP for IPv6: الـ Classic والـ Named
- تشخيص EIGRP: ثلاث مشاكل في طريق واحد
- OSPF: حالات الجيرة، و Hello، و MTU
- OSPF: أنواع الشبكات و الـ DR و الـ BDR
- OSPF: أنواع الـ LSAs وقراءة الـ Database
- OSPF: ترتيب تفضيل المسارات وقاعدة الـ Backbone
- OSPF: الـ Stub و Totally Stubby Areas
- OSPF: الـ NSSA و LSA النوع سبعة
- OSPF: التلخيص في الـ ABR والـ ASBR
- OSPF: الفلترة الصحيحة بين الـ Areas
- OSPF: الـ Virtual Link لـ Area مفصولة
- OSPF: الـ Cost والـ Reference Bandwidth
- OSPF: الـ Authentication بـ MD5 و SHA
- OSPFv3: الـ OSPF حق IPv6
- تشخيص OSPF: جيران ما يطلعون
- BGP: الجلسات وحالاتها
- BGP: الـ iBGP بين الـ Loopbacks
- BGP: الـ Next Hop في الـ iBGP و next-hop-self
- BGP: الـ Route Reflector بدل الـ Full Mesh
- BGP: خوارزمية اختيار أفضل مسار
- BGP: التحكم في الترافيك الطالع بالـ Weight والـ Local Preference
- BGP: التحكم في الترافيك الداخل بالـ AS Path Prepend والـ MED
- BGP: الفلترة بالـ Prefix List وخطر الـ Transit
- BGP: الـ Regular Expressions و AS Path Filter
- BGP: الـ Communities و no-export
- BGP: حماية الجلسات بالـ Password و TTL Security
- MP-BGP: BGP لـ IPv6 بالـ Address Families
- تشخيص BGP: جلسات واقعة ومسار مو valid
- MPLS و LDP: Core بدون BGP
- MPLS Layer 3 VPN: الـ VRF و RD و RT و VPNv4
- تشخيص MPLS VPN: من الـ Core لفوق
- DMVPN: الـ mGRE و NHRP
- DMVPN: التوجيه فوق النفق و Phase 2
- DMVPN: الـ Phase 3 والحماية بـ IPsec
- AAA: TACACS+ و RADIUS وتشخيص الدخول
- الـ ACLs: الترتيب، والـ Sequence Numbers، والمكان الصح
- الـ Time-Based ACL: صلاحيات حسب الوقت
- الـ ACLs في IPv6 وفخ الـ Neighbor Discovery
- الـ uRPF: الحماية من العناوين المزوّرة
- الـ CoPP: حماية الـ Control Plane
- حماية الـ Management Plane: SSH و Access-Class
- IPv6 First-Hop Security: RA Guard و DHCPv6 Guard و Source Guard
- الدخول على الأجهزة والـ Backup بـ TFTP
- SNMP: من v2c المكشوف إلى SNMPv3
- الـ Syslog: مستويات الخطورة ووين تروح الرسائل
- الـ Debug بشرط: بدون ما تغرق الراوتر
- DHCP و الـ Relay: تشخيص أجهزة ما تاخذ عنوان
- DHCPv6: Stateful و Stateless والـ Relay
- الـ IP SLA و Object Tracking: Failover ذكي بين مزوّدين
- الـ Flexible NetFlow: مين يتكلم مع مين
- Catalyst Center Assurance: التشخيص من لوحة وحدة
- مشروع التشخيص الكامل: الشركة طاحت من الإنترنت
- الخاتمة: الاستعداد لاختبار ENARSI و وش بعده