تفترض المقالة أن القارئ لديه بالفعل فهم أساسيات MPLS L3VPN .مرحبًا لنفترض أنك
مزود خدمة إنترنت . ومثل أي ISP كبير إلى حد ما ، فإن جوهر شبكتك يعتمد على IP / MPLS. إذا قمت بتبسيطها تمامًا ، فيمكن تمثيل شبكتك من خلال الدائرة الموضحة أعلاه. لنفترض أيضًا أنك ، بصفتك مزود خدمة الإنترنت ، تبيع لعملائك خدمة L3VPN ، والتي يتم تنفيذها على شبكتك وفقًا لـ RFC 4364 (شبكات VPN BGP / MPLS IP). وفي حالة عدم امتلاك عميل L3VPN على موقع معين بما يكفي من الشبكات المتصلة بشكل مباشر ويريد الإعلان عن مسارات إضافية إلى مواقع أخرى ، فإنك ترفع جلسة BGP بين معداتك (PE) ومعدات العميل (CE) ، والتي من خلالها يمكن للعميل الإعلان عن المطلوب الطرق. مع كل هذا ، لا تقوم بتطبيق أي فلاتر / سياسات على هذه الجلسة ، مسترشدة بحقيقة أنه ، كما يقولون ، عميل VPN ، وأنه حر في "قيادة" أي شيء يريده (في حدود عدد البادئات ، على سبيل المثال). والآن الانتباه ، السؤال هو: ماذا يحدث إذا ، في إطار جلسة BGP هذه ، أعلن العميل عن المسارات لك (المزود) ، مضيفًا مجتمع توجيه الهدف لهم؟ قد يكون هذا ، على سبيل المثال ، نتيجة خطأ ، أو الرغبة في التجربة.
في هذه الحالة فقط ، نتذكر أن هدف التوجيه هو أحد مجتمعات BGP الممتدة الخاصة المستخدمة في MPLS L3VPN لتحديد VRF ، في جدول التوجيه الذي من الضروري تعيين المسار الذي جاء عبر MP-BGP. وبما أن RT مجتمع ، فمن الناحية النظرية ، لا شيء يمنعنا من إضافته إلى مسارات IPv4 العادية.
دعونا نعود إلى السؤال عما يمكن أن يحدث إذا أعلنت CE عن الطرق التي تحمل علامة RT على PE (لا توجد سياسات BGP على PE). بعد قليل من التفكير ، يمكننا أن نفترض أن هناك 3 نتائج مختلفة:
- سوف يسقط PE مثل هذا الإعلان.
- سوف يقوم PE بإزالة RT من الإعلان ، وإضافة VRF RT المطابق إليه ، وإرسال الإعلان إلى PEs الأخرى.
- سوف يقبل PE الإعلان بدون تغيير ، أضف VRF RT المقابل له (أي ، سيتم تضمين اثنين من RT بالفعل في الإعلان) ويرسل الإعلان إلى PEs الأخرى.
الخيار الأكثر إثارة للاهتمام والخطير في نفس الوقت لمزود الخدمة هو بالطبع الخيار الأخير. في هذه الحالة ، يمكن أن يعطل العميل التوجيه في VRFs الأخرى ، سواء العميل أو الداخلي ، والتكنولوجي.
لكن تخمين جميل ، دعونا نتحقق. لمزيد من الاهتمام ، سنقوم بالتحقق على الفور من العديد من أنظمة تشغيل الشبكة. في Eve-NG ، تم بناء المخطط التالي:

قائمة المشاركين في الاختبار:
- CHR - Mikrotik CHR ، RouterOS 6.40.8
- VSR - Nokia VSR ، TiMOS 15.0.R6
- vMX - Juniper vMX ، JUNOS 14.1R1.10
- XRv - Cisco XRv ، IOS-XR 6.1.1
- 3725 - Cisco 3725 (Dynamips) ، IOS 12.4
الموجهات المساعدة:
- Remote-PE - Cisco 3725 (Dynamips) ، IOS 12.4
- CE - Mikrotik CHR ، RouterOS 6.40.8
وصف الدائرة:
- المشاركون في الاختبار - أجهزة التوجيه PE. تم إنشاء VRF-100 (RT 65001: 100) على كل منها ؛ في إطار VRF-100 ، تم تنظيم جلسة BGP مع CE بدون أي فلاتر / سياسات.
- يحتوي كل من PEs المختبرة على جلسة MP-BGP مع جهاز توجيه Remote_PE ، والتي تمر من خلالها مسارات VRF.
- يحتوي جهاز التوجيه CE على 5 واجهات فرعية (1 لكل PE) ، في كل واجهة فرعية يتم رفع جلسة BGP إلى CE المقابلة. يتم الإعلان عن كل PE PE بادئة خاصة به من النموذج 1.1.1. N / 32 ، حيث N هو رقم تسلسل PE من اليسار إلى اليمين. مع سياسة تصدير CE ، تتم إضافة مجتمع RT: 65001: 200 إلى كل من هذه البادئات.
- تم إنشاء جهازي VRFs على Remote_PE: VRF-100 (RT 65001: 100) و VRF-200 (RT 65001: 200)
- يتم حذف نقل MPLS ، والموجهات P ، و RR وغيرها من الأفراح الموجودة عادة في شبكة حقيقية ، لأن لا يهمنا هنا.
بالنسبة لأولئك الذين ليسوا راضين عن الوصف "بالكلمات فقط" ، سأحضر تكوينات جميع الأجهزة المعنية.
م/interface vlan add interface=ether1 name=ether1.10 vlan-id=10 add interface=ether1 name=ether1.20 vlan-id=20 add interface=ether1 name=ether1.30 vlan-id=30 add interface=ether1 name=ether1.40 vlan-id=40 add interface=ether1 name=ether1.50 vlan-id=50 /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /routing bgp instance set default as=65002 /ip address add address=192.168.30.2/24 interface=ether1.30 network=192.168.30.0 add address=192.168.10.2/24 interface=ether1.10 network=192.168.10.0 add address=192.168.20.2/24 interface=ether1.20 network=192.168.20.0 add address=192.168.40.2/24 interface=ether1.40 network=192.168.40.0 add address=192.168.50.2/24 interface=ether1.50 network=192.168.50.0 /ip dhcp-client add disabled=no interface=ether3 add disabled=no interface=ether1.30 /ip route add distance=1 dst-address=1.1.1.1/32 type=blackhole add distance=1 dst-address=1.1.1.2/32 type=blackhole add distance=1 dst-address=1.1.1.3/32 type=blackhole add distance=1 dst-address=1.1.1.4/32 type=blackhole add distance=1 dst-address=1.1.1.5/32 type=blackhole /routing bgp network add network=1.1.1.3/32 add network=1.1.1.1/32 add network=1.1.1.2/32 add network=1.1.1.4/32 add network=1.1.1.5/32 /routing bgp peer add comment=VMX name=VMX out-filter=TO-VMX remote-address=192.168.30.1 \ remote-as=65001 add comment=CHR name=CHR out-filter=TO-CHR remote-address=192.168.10.1 \ remote-as=65001 add comment=VSR name=VSR out-filter=TO-VSR remote-address=192.168.20.1 \ remote-as=65001 add comment=XRV name=XRV out-filter=TO-XRV remote-address=192.168.40.1 \ remote-as=65001 add comment=3725 name=3725 out-filter=TO-3725 remote-address=192.168.50.1 \ remote-as=65001 /routing filter add action=accept chain=TO-VMX prefix=1.1.1.3 set-route-targets=65001:200 add action=accept chain=TO-CHR prefix=1.1.1.1 set-route-targets=65001:200 add action=accept chain=TO-VSR prefix=1.1.1.2 set-route-targets=65001:200 add action=accept chain=TO-XRV prefix=1.1.1.4 set-route-targets=65001:200 add action=accept chain=TO-3725 prefix=1.1.1.5 set-route-targets=65001:200 add action=discard chain=TO-VMX add action=discard chain=TO-CHR add action=discard chain=TO-VSR add action=discard chain=TO-XRV add action=discard chain=TO-3725 /system identity set name=CE
CHR /interface bridge add name=lo0 protocol-mode=none /interface vlan add interface=ether1 name=ether1.10 vlan-id=10 add interface=ether2 name=ether2.10 vlan-id=10 /interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik /routing bgp instance set default as=65001 add as=65001 name=vrf-100 redistribute-other-bgp=yes router-id=192.168.10.1 \ routing-table=VRF-100 /ip address add address=192.168.10.1/24 interface=ether1.10 network=192.168.10.0 add address=10.0.1.1/24 interface=ether2.10 network=10.0.1.0 add address=10.1.1.1 interface=lo0 network=10.1.1.1 /ip dhcp-client add disabled=no interface=ether1 /ip route vrf add export-route-targets=65001:100 import-route-targets=65001:100 interfaces=\ ether1.10 route-distinguisher=65001:100 routing-mark=VRF-100 /routing bgp instance vrf add redistribute-other-bgp=yes routing-mark=VRF-100 /routing bgp peer add address-families=vpnv4 comment=remote_PE name=remote_PE remote-address=\ 10.10.10.10 remote-as=65001 update-source=lo0 add comment=CE instance=vrf-100 name=CE remote-address=192.168.10.2 \ remote-as=65002 /routing ospf network add area=backbone network=10.0.0.0/8 /system identity set name=CHR
Vsr # TiMOS-B-15.0.R6 both/x86_64 Nokia 7750 SR Copyright (c) 2000-2017 Nokia. # All rights reserved. All use subject to applicable license agreements. # Built on Mon Nov 20 12:58:19 PST 2017 by builder in /builds/150B/R6/panos/main # Generated MON JAN 01 00:32:55 2018 UTC exit all configure #-------------------------------------------------- echo "System Configuration" #-------------------------------------------------- system snmp shutdown exit time sntp shutdown exit zone UTC exit exit #-------------------------------------------------- echo "System Security Configuration" #-------------------------------------------------- system security dist-cpu-protection policy "_default-access-policy" create exit policy "_default-network-policy" create exit exit exit exit #-------------------------------------------------- echo "Log Configuration" #-------------------------------------------------- log exit #-------------------------------------------------- echo "Card Configuration" #-------------------------------------------------- card 1 card-type iom-v mda 1 mda-type m20-v no shutdown exit no shutdown exit #-------------------------------------------------- echo "Port Configuration" #-------------------------------------------------- port 1/1/1 description "CE" ethernet mode hybrid encap-type qinq exit no shutdown exit port 1/1/2 description "remote_PE" ethernet mode hybrid encap-type qinq exit no shutdown exit port 1/1/3 shutdown ethernet exit exit port 1/1/4 shutdown ethernet exit exit #-------------------------------------------------- echo "Management Router Configuration" #-------------------------------------------------- router management exit #-------------------------------------------------- echo "Router (Network Side) Configuration" #-------------------------------------------------- router Base interface "remote_PE" address 10.0.2.1/24 port 1/1/2:20.* no shutdown exit interface "system" address 10.2.2.2/32 no shutdown exit autonomous-system 65001 #-------------------------------------------------- echo "OSPFv2 Configuration" #-------------------------------------------------- ospf 0 area 0.0.0.0 interface "system" no shutdown exit interface "remote_PE" mtu 1500 no shutdown exit exit no shutdown exit exit #-------------------------------------------------- echo "Service Configuration" #-------------------------------------------------- service customer 1 create description "Default customer" exit vprn 100 customer 1 create autonomous-system 65001 route-distinguisher 65001:100 vrf-target target:65001:100 interface "CE" create address 192.168.20.1/24 sap 1/1/1:20.0 create exit exit bgp group "CE" type external export "TO-CE" peer-as 65002 neighbor 192.168.20.2 exit exit no shutdown exit service-name "VRF-100" no shutdown exit exit #-------------------------------------------------- echo "Router (Service Side) Configuration" #-------------------------------------------------- router Base #-------------------------------------------------- echo "OSPFv2 Configuration" #-------------------------------------------------- ospf 0 no shutdown exit #-------------------------------------------------- echo "Policy Configuration" #-------------------------------------------------- policy-options begin policy-statement "TO-CE" entry 10 action accept exit exit exit commit exit #-------------------------------------------------- echo "BGP Configuration" #-------------------------------------------------- bgp group "remote_PE" family vpn-ipv4 type internal local-address system neighbor 10.0.2.2 exit exit no shutdown exit exit exit all
vMX ## Last commit: 2018-05-25 12:37:27 UTC by root version 14.1R1.10; system { host-name vmx01; root-authentication { encrypted-password "$1$zA/8snt5$g3mYVmz7MzTZZOhtjRX6g1"; ## SECRET-DATA } } interfaces { ge-0/0/0 { vlan-tagging; encapsulation flexible-ethernet-services; unit 30 { vlan-id 30; family inet { address 192.168.30.1/24; } } } ge-0/0/1 { vlan-tagging; encapsulation flexible-ethernet-services; unit 30 { vlan-id 30; family inet { address 10.0.3.1/24; } } } lo0 { unit 0 { family inet { address 10.3.3.3/32; } } } } routing-options { autonomous-system 65001; } protocols { bgp { group remote_PE { type internal; local-address 10.3.3.3; family inet-vpn { unicast; } neighbor 10.10.10.10; } } ospf { area 0.0.0.0 { interface lo0.0; interface ge-0/0/1.30; } } } routing-instances { VRF-100 { instance-type vrf; interface ge-0/0/0.30; route-distinguisher 65001:100; vrf-target target:65001:100; protocols { bgp { group CE { type external; peer-as 65002; neighbor 192.168.30.2; } } } } }
Xrv !! IOS XR Configuration 6.1.1 !! Last configuration change at Fri May 25 15:24:01 2018 by Cisco ! hostname XRv vrf VRF-100 address-family ipv4 unicast import route-target 65001:100 ! export route-target 65001:100 ! ! ! interface Loopback0 no shutdown ipv4 address 10.4.4.4 255.255.255.255 ! interface MgmtEth0/0/CPU0/0 no shutdown shutdown ! interface GigabitEthernet0/0/0/0.40 no shutdown vrf VRF-100 ipv4 address 192.168.40.1 255.255.255.0 encapsulation dot1q 40 ! interface GigabitEthernet0/0/0/1.40 no shutdown ipv4 address 10.0.4.1 255.255.255.0 encapsulation dot1q 40 ! interface GigabitEthernet0/0/0/2 no shutdown shutdown ! route-policy TO-CE pass end-policy ! route-policy FROM-CE pass end-policy ! router ospf main area 0 interface Loopback0 ! interface GigabitEthernet0/0/0/1.40 ! ! ! router bgp 65001 address-family ipv4 unicast ! address-family vpnv4 unicast ! neighbor 10.10.10.10 remote-as 65001 update-source Loopback0 address-family vpnv4 unicast ! ! vrf VRF-100 rd 65001:100 bgp router-id 192.168.40.1 address-family ipv4 unicast ! neighbor 192.168.40.2 remote-as 65002 address-family ipv4 unicast route-policy FROM-CE in route-policy TO-CE out ! ! ! ! end
3725 ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname 3725 ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 ip cef ! ! ! ! ip vrf VRF-100 rd 65001:100 route-target export 65001:100 route-target import 65001:100 ! no ip domain lookup ! multilink bundle-name authenticated ! ! ! archive log config hidekeys ! ! ! interface Loopback0 ip address 10.5.5.5 255.255.255.255 ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.50 encapsulation dot1Q 50 ip vrf forwarding VRF-100 ip address 192.168.50.1 255.255.255.0 ! interface FastEthernet0/1 no ip address duplex auto speed auto ! interface FastEthernet0/1.50 encapsulation dot1Q 50 ip address 10.0.5.1 255.255.255.0 ! router ospf 123 log-adjacency-changes network 10.0.0.0 0.255.255.255 area 0 ! router bgp 65001 no bgp default ipv4-unicast no bgp default route-target filter bgp log-neighbor-changes neighbor 10.10.10.10 remote-as 65001 neighbor 10.10.10.10 update-source Loopback0 ! address-family vpnv4 neighbor 10.10.10.10 activate neighbor 10.10.10.10 send-community extended exit-address-family ! address-family ipv4 vrf VRF-200 no synchronization exit-address-family ! address-family ipv4 vrf VRF-100 neighbor 192.168.50.2 remote-as 65002 neighbor 192.168.50.2 activate neighbor 192.168.50.2 soft-reconfiguration inbound no synchronization exit-address-family ! ip forward-protocol nd ! ! ip http server no ip http secure-server ! ! ! control-plane ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
Remote_PE ! version 12.4 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname remote_PE ! boot-start-marker boot-end-marker ! ! no aaa new-model memory-size iomem 5 ip cef ! ! ! ! ip vrf VRF-100 rd 65001:100 route-target export 65001:100 route-target import 65001:100 ! ip vrf VRF-200 rd 65001:200 route-target export 65001:200 route-target import 65001:200 ! ! multilink bundle-name authenticated ! ! ! ! archive log config hidekeys ! ! ! ! interface Loopback0 ip address 10.10.10.10 255.255.255.255 ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.10 description CHR encapsulation dot1Q 10 ip address 10.0.1.2 255.255.255.0 ! interface FastEthernet0/0.20 encapsulation dot1Q 20 ip address 10.0.2.2 255.255.255.0 ! interface FastEthernet0/0.30 encapsulation dot1Q 30 ip address 10.0.3.2 255.255.255.0 ! interface FastEthernet0/0.40 encapsulation dot1Q 40 ip address 10.0.4.2 255.255.255.0 ! interface FastEthernet0/0.50 encapsulation dot1Q 50 ip address 10.0.5.2 255.255.255.0 ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! router ospf 123 log-adjacency-changes network 10.0.0.0 0.255.255.255 area 0 ! router bgp 65001 no bgp default ipv4-unicast no bgp default route-target filter bgp log-neighbor-changes neighbor 10.1.1.1 remote-as 65001 neighbor 10.2.2.2 remote-as 65001 neighbor 10.3.3.3 remote-as 65001 neighbor 10.4.4.4 remote-as 65001 neighbor 10.5.5.5 remote-as 65001 ! address-family vpnv4 neighbor 10.1.1.1 activate neighbor 10.1.1.1 send-community extended neighbor 10.2.2.2 activate neighbor 10.2.2.2 send-community extended neighbor 10.3.3.3 activate neighbor 10.3.3.3 send-community extended neighbor 10.4.4.4 activate neighbor 10.4.4.4 send-community extended neighbor 10.5.5.5 activate neighbor 10.5.5.5 send-community extended exit-address-family ! address-family ipv4 vrf VRF-200 no synchronization exit-address-family ! address-family ipv4 vrf VRF-100 redistribute connected no synchronization exit-address-family ! ip forward-protocol nd ! ! ip http server no ip http secure-server ! ! control-plane ! ! ! line con 0 line aux 0 line vty 0 4 login ! ! end
إعلانات CE-> PE
لذا ، فإن التجربة بسيطة: مع CE نعلن عن المسارات التي تحمل علامة RT: 65001: 200 ، على Remote-PE ، نتطلع لمعرفة ما إذا كانت هذه المسارات تظهر في جدول التوجيه VRF-200.
أولاً ، تحقق من جدول التوجيه VRF-100:
remote_PE#show ip route vrf VRF-100 1.1.1.0 255.255.255.0 longer-prefixes Routing Table: VRF-100 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 5 subnets B 1.1.1.1 [200/0] via 10.1.1.1, 00:01:02 B 1.1.1.3 [200/0] via 10.3.3.3, 05:19:08 B 1.1.1.2 [200/0] via 10.2.2.2, 00:02:47 B 1.1.1.5 [200/0] via 10.5.5.5, 01:36:05 B 1.1.1.4 [200/0] via 10.4.4.4, 02:32:21 remote_PE#
تلقينا الطرق من جميع PE 5. تحقق الآن لمعرفة ما إذا كان أي من هذه المسارات موجودًا في VRF-200:
remote_PE#show ip route vrf VRF-200 Routing Table: VRF-200 Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 3 subnets B 1.1.1.1 [200/0] via 10.1.1.1, 00:01:24 B 1.1.1.3 [200/0] via 10.3.3.3, 05:19:29 B 1.1.1.2 [200/0] via 10.2.2.2, 00:03:08 remote_PE#
انتهت المسارات من CHR و vMX و VSR في VRF-200. هذا يعني أن مجتمع RT: 65001: 200 المضاف إلى CE تم حفظه بواسطة هؤلاء الأشخاص.
في الوقت نفسه ، لا تتوفر المسارات من XRv و 3725 إلا في VRF-100. هذا يعني أن موجهات سيسكو أزالت مجتمع RT: 65001: 200 من الإعلان.
إعلانات PE-> م
لن نتوقف عند هذا الحد ونتحقق من سلوك الإعلانات في الاتجاه المعاكس ، أي من PE إلى CE. سنقوم بتعديل التكوينات الموجودة قليلاً.
على Remote_PE ، أنشئ
استرجاعًا سيتم الإعلان عن عنوانه
100.100.100.100/32 بواسطة PE آخر:
interface Loopback100 ip vrf forwarding VRF-100 ip address 100.100.100.100 255.255.255.255 ! router bgp 65001 address-family ipv4 vrf VRF-100 redistribute connected exit-address-family !
على vMX ، تذكر أننا لم نقم بتكوين نقل MPLS ، مما يعني أن جدول inet.3 فارغًا ، وسيتم إخفاء المسار من Remote_PE. انسخ مسارات OSPF إلى inet.3.
set routing-options rib-groups RG-INET3 import-rib [ inet.0 inet.3 ] set protocols ospf rib-group RG-INET3
في بقية الموجهات ، يجب أن تكون الإعدادات الحالية كافية.
نحن ننظر إلى الطرق على CE:
[admin@CE] > ip route print detail where dst-address=100.100.100.100/32 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 ADb dst-address=100.100.100.100/32 gateway=192.168.20.1 gateway-status=192.168.20.1 reachable via ether1.20 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=VSR 1 Db dst-address=100.100.100.100/32 gateway=192.168.50.1 gateway-status=192.168.50.1 reachable via ether1.50 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete received-from=3725 2 Db dst-address=100.100.100.100/32 gateway=192.168.10.1 gateway-status=192.168.10.1 reachable via ether1.10 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=CHR 3 Db dst-address=100.100.100.100/32 gateway=192.168.30.1 gateway-status=192.168.30.1 reachable via ether1.30 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=VMX 4 Db dst-address=100.100.100.100/32 gateway=192.168.40.1 gateway-status=192.168.40.1 reachable via ether1.40 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete received-from=XRV
غادرت جميع أجهزة التوجيه باستثناء Cisco مسار الهدف في الإعلان عن المسار. لم تفعل Cisco ذلك لمجرد إرسال أي مجتمع إليهم بشكل افتراضي. أصلحه.
3725: *
router bgp 65001 address-family ipv4 vrf VRF-100 neighbor 192.168.50.2 send-community extended
XRv: *
router bgp 65001 vrf VRF-100 neighbor 192.168.40.2 address-family ipv4 unicast send-extended-community-ebgp
* لا يؤدي استخدام هذه الأوامر إلى تغيير نتائج التجربة الأولى بأي شكل من الأشكال مع إعلانات CE-> PE.الآن انظر إلى المسار على CE مرة أخرى:
[admin@CE] > ip route print detail where dst-address=100.100.100.100/32 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 ADb dst-address=100.100.100.100/32 gateway=192.168.20.1 gateway-status=192.168.20.1 reachable via ether1.20 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=VSR 1 Db dst-address=100.100.100.100/32 gateway=192.168.50.1 gateway-status=192.168.50.1 reachable via ether1.50 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=3725 2 Db dst-address=100.100.100.100/32 gateway=192.168.10.1 gateway-status=192.168.10.1 reachable via ether1.10 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=CHR 3 Db dst-address=100.100.100.100/32 gateway=192.168.30.1 gateway-status=192.168.30.1 reachable via ether1.30 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=VMX 4 Db dst-address=100.100.100.100/32 gateway=192.168.40.1 gateway-status=192.168.40.1 reachable via ether1.40 distance=20 scope=40 target-scope=10 bgp-as-path="65001" bgp-origin=incomplete bgp-ext-communities="RT:65001:100" received-from=XRV
الآن جميع PEs على الإطلاق يرسلون الطرق مع إشارة RT نحو CE.
كانت نتيجة مشابهة لي شخصياً تبدو غريبة إلى حد ما. أثناء الحفاظ على RT في إعلان CE-> PE يمكن أن يأتي من الناحية النظرية بتطبيق ، ثم في إعلان PE-> CE يبدو من الواضح أن المعلومات غير ضرورية.
بالإضافة إلى ذلك ، يمكن أن يكون لوجود ظواهر الحفاظ على RT على كل من CE-> PE ونحو PE-> CE تأثير سلبي على Inter-AS Option A.
عنوان "ما يخبرنا به RFC"
يذكر RFC 4364 ، المذكور في بداية المقالة ، على وجه التحديد ما يلي:
إذا كان PE و CE هم أنفسهم نظراء BGP ، إذن
قد تسمح النقاط الذهنية للعميل ، في حدود ، بتحديد كيفية عملها
سيتم توزيع الطرق. سوف يحتاج SP والعميل إلى
الموافقة مسبقًا على مجموعة RTs المسموح بإلحاقها
مسارات VPN للعميل. يمكن أن يرفق CE بعد ذلك بواحد أو أكثر
تلك RTs لكل توجيه IP يوزعه على PE. هذا يعطي
للعميل حرية التحديد في الوقت الحقيقي ، ضمن المتفق عليه
حدود ، سياسات توزيع الطريق. إذا سمح CE بذلك
إرفاق RTs بمساراتها ، يجب على PE تصفية جميع الطرق التي
تحتوي على RTs غير مسموح للعميل باستخدامها. إذا كان CE
غير مسموح له بتوصيل RTs بمساراته ، ولكنه يفعل ذلك على أي حال ، PE
يجب إزالة RT قبل تحويل مسار العميل إلى VPN-
مسار IPv4.
وبالتالي ، فإن الحفاظ على RT في الإعلانات CE-> PE له أساس قانوني تمامًا ، على الرغم من أن التطبيق العملي لهذا يبدو مشكوكًا فيه إلى حد ما.
حول RT في الإعلانات PE-> CE ، RFC يقول شيئا.
إزالة RT من الجلسات مع CE
كل شيء واضح مع Cisco مقدمًا. في إعلانات CE-> PE ، يتم حذف جميع تقارير RT بشكل قاطع (لم أتمكن من العثور على أمر يغير هذا السلوك) ، في إعلانات PE-> CE RT غير موجودة افتراضيًا ، يكفي عدم تمكين إرسال المجتمعات الموسعة.
سنكتشف كيفية التخلص من RT على المشاركين الآخرين في الاختبار.
العرعر
كل ما عليك فعله لإزالة RT من الإعلانات (على حد سواء PE-> CE و CE-> PE) هو إنشاء سياسة والمصطلح الأول لإزالة جميع المجتمعات بدءًا بـ "الهدف:" ، مع إعطاء البادئة لـ المعالجة في الشروط التالية.
على سبيل المثال ، إذا أردنا قبول جميع المسارات والإعلان عنها ، فما عليك سوى إزالة RT منها:
edit policy-options set community RT-ALL members target:.+:.+ set policy-statement TO-CE term 10 then community delete RT-ALL set policy-statement TO-CE term 10 then next term set policy-statement TO-CE then accept copy policy-statement TO-CE to policy-statement FROM-CE
نوكيا
لتعطيل إرسال المجتمعات الموسعة إلى نظير BGP ، يمكنك استخدام الأمر:
configure service vprn "VRF-100" bgp group "CE" disable-communities extended
لإزالة RT من إعلانات CE ، تحتاج إلى إنشاء سياسة مشابهة لما تم في Juniper ، وتطبيقها على جلسة مع CE.
configure router policy-options begin community "RT-ALL" members "target:.+&.+" policy-statement FROM-CE entry 10 action next-entry community remove "RT-ALL" exit exit default-action accept exit exit commit
Mikrotik
ولكن مع Mikrotik ، تنتظرنا خيبة الأمل. ببساطة لا توجد آلية لإزالة RT من الإعلان. يبدو أنه في فلتر التوجيه يوجد معلمة set-route-target ، وستفعل شيئًا مثل
/routing filter add chain=TO-CE set-route-targets="" action=passthrough add chain=TO-CE action=accept
ولكن ، لسوء الحظ ، تعني set-route-target = "" أنه يجب إزالة هذه المعلمة (set-route-target) تمامًا من القاعدة. مثال:
[admin@CE] /routing filter> add chain=TO-CE action=passthrough set-route-targets="" [admin@CE /routing filter> print where chain=TO-CE Flags: X - disabled 0 chain=TO-CE invert-match=no action=passthrough set-bgp-prepend-path=""
في هذه الحالة ، لا يزال من الجدير بالذكر أن Mikrotik هو في المقام الأول جهاز توجيه SOHO متقدم ، وربما لا يكون من المناسب تمامًا طلب نفس الوظيفة منه الموجودة في جهاز التوجيه من فئة الناقل. يبقى الاعتماد على RouterOS 7.
الاستنتاجات
بإضافة RT المطلوب لإعلاناتك ، سيظل عميلك غير قادر على الوصول إلى MGMT VRF ، على سبيل المثال ، لأن سيكون الاتصال في اتجاه واحد. ومع ذلك ، من الممكن تمامًا أن يقوم العميل بتعطيل التوجيه في MGMT VRF (بالطبع ، لهذا تحتاج إلى التخمين مع RT ومع المسارات المعلنة).
بالإضافة إلى ذلك ، عند تنفيذ الخيار Inter-AS Option A ، من الممكن أن يدخل مسار من الموفر A إلى شبكة الموفر B ، مع الحفاظ على RT. علاوة على ذلك ، إذا تم استخدام RT بالفعل في شبكة الموفر B تحت بعض VRF أخرى ، فإن المسار يتسرب إلى VRF ، وهو بالطبع ليس السلوك المطلوب.
وبالتالي ، فإن المشكلة ليست كبيرة للغاية ، لأنه لكي تتمكن من "التصوير" ، يجب أن تتزامن عدة عوامل معًا. من ناحية أخرى ، فإن تصحيح هذا السلوك غير المرغوب فيه أسهل بكثير من معرفة لماذا "لا يعمل" فجأة.
مرة أخرى ، باختصار شديد:
1. إن أمكن ، قم بقطع RT من الإعلانات بين PE و CE (ما لم تكن بحاجة إليها بالطبع).
2. بناءً على نتائج الاختبار ، يمكن لمالكي cisco-PE النوم بسلام ، ويتم قطع RT على الجهاز. ومع ذلك ، فقط في حالة ، سوف أتحقق مرة أخرى. ربما يكون السلوك مختلفًا في الإصدارات الأخرى من iOS.