تخطَّ إلى المحتوى

تهيئة BIG-IP

  • (مثال على نطاق المسار 0)

جميع الأوامر أدناه تُشغَّل في tmsh على BIG-IP. قم بتعديل أسماء الكائنات وعناوين IP حسب الحاجة.

للاطلاع على التهيئة العامة لأنفاق GRE على BIG-IP، راجع Configuring a GRE Tunnel Using BIG-IP. للاطلاع على الإعداد الأولي لتهيئة التوجيه مع السحابة، راجع K000147949.

tmsh
[root@bigip:Active]# tmsh
root@(bigip)(cfg-sync Standalone)(Active)(/Common)(tmos)#

عناوين IP الذاتية الخارجية

Section titled “عناوين IP الذاتية الخارجية”

نقاط نهاية GRE

هذه هي عناوين IP الموجودة على كل وحدة BIG-IP والمستخدمة كـ نقاط نهاية لنفق GRE، وتكون عادةً على الشبكة المحلية الافتراضية الخارجية (VLAN). لكل وحدة عنوان IP ذاتي خارجي خاص بها وغير عائم (traffic-group-local-only):

BIG-IP-A:

tmsh
create net self xc-ddos-v4-self-a \
vlan external \
traffic-group traffic-group-local-only \
allow-service add { icmp:any gre:any } \
address xBIGIP_A_OUTER_V4x/24
create net self xc-ddos-v6-self-a \
vlan external \
traffic-group traffic-group-local-only \
allow-service add { icmp:any gre:any } \
address xBIGIP_A_OUTER_V6x/64

BIG-IP-B:

tmsh
create net self xc-ddos-v4-self-b \
vlan external \
traffic-group traffic-group-local-only \
allow-service add { icmp:any gre:any } \
address xBIGIP_B_OUTER_V4x/24
create net self xc-ddos-v6-self-b \
vlan external \
traffic-group traffic-group-local-only \
allow-service add { icmp:any gre:any } \
address xBIGIP_B_OUTER_V6x/64

يشير كل نفق من وحدة BIG-IP إلى نقطة نهاية مركز فرز السحابة. أنشئ نفقَين لكل وحدة (واحد لكل مركز فرز موزّع جغرافيًا) ليصبح المجموع أربعة أنفاق منطقية عبر زوج عالي التوفر:

النفق C1-T1 — BIG-IP-A إلى xCENTER_1x:

tmsh
create net tunnels tunnel xc-ddos-c1t1-v4 \
local-address xBIGIP_A_OUTER_V4x \
profile gre \
remote-address xXC_C1_OUTER_V4x
create net tunnels tunnel xc-ddos-c1t1-v6 \
local-address xBIGIP_A_OUTER_V6x \
profile gre \
remote-address xXC_C1_OUTER_V6x

النفق C2-T1 — BIG-IP-A إلى xCENTER_2x:

tmsh
create net tunnels tunnel xc-ddos-c2t1-v4 \
local-address xBIGIP_A_OUTER_V4x \
profile gre \
remote-address xXC_C2_OUTER_V4x
create net tunnels tunnel xc-ddos-c2t1-v6 \
local-address xBIGIP_A_OUTER_V6x \
profile gre \
remote-address xXC_C2_OUTER_V6x

النفق C1-T2 — BIG-IP-B إلى xCENTER_1x:

tmsh
create net tunnels tunnel xc-ddos-c1t2-v4 \
local-address xBIGIP_B_OUTER_V4x \
profile gre \
remote-address xXC_C1_OUTER_V4x
create net tunnels tunnel xc-ddos-c1t2-v6 \
local-address xBIGIP_B_OUTER_V6x \
profile gre \
remote-address xXC_C1_OUTER_V6x

النفق C2-T2 — BIG-IP-B إلى xCENTER_2x:

tmsh
create net tunnels tunnel xc-ddos-c2t2-v4 \
local-address xBIGIP_B_OUTER_V4x \
profile gre \
remote-address xXC_C2_OUTER_V4x
create net tunnels tunnel xc-ddos-c2t2-v6 \
local-address xBIGIP_B_OUTER_V6x \
profile gre \
remote-address xXC_C2_OUTER_V6x

أسماء الأنفاق (xc-ddos-c1t1-v4 وغيرها) اختيارية؛ استخدم اصطلاح التسمية الخاص بك.

يضيف تغليف GRE حملًا إضافيًا (24 بايت للغلاف الخارجي IPv4، و44 بايتًا للغلاف الخارجي IPv6). بدون قيمة MTU صريحة، ستتجزأ الحزم القريبة من 1500 بايت أو سيتم إسقاطها. اضبط MTU للنفق لمراعاة الحمل الإضافي للتغليف:

tmsh
modify net tunnels tunnel xc-ddos-c1t1-v4 mtu 1476
modify net tunnels tunnel xc-ddos-c1t1-v6 mtu 1456
modify net tunnels tunnel xc-ddos-c1t2-v4 mtu 1476
modify net tunnels tunnel xc-ddos-c1t2-v6 mtu 1456
modify net tunnels tunnel xc-ddos-c2t1-v4 mtu 1476
modify net tunnels tunnel xc-ddos-c2t1-v6 mtu 1456
modify net tunnels tunnel xc-ddos-c2t2-v4 mtu 1476
modify net tunnels tunnel xc-ddos-c2t2-v6 mtu 1456

مكافحة انتحال GRE (قوائم التحكم في الوصول الأعلى)

Section titled “مكافحة انتحال GRE (قوائم التحكم في الوصول الأعلى)”

لا يوفر GRE (بروتوكول IP رقم 47) أي مصادقة. يستطيع أي شخص يعرف زوج عناوين IP الخارجية حقن حركة المرور في النفق. طبّق قوائم التحكم في الوصول (ACLs) على الموجّه الأعلى أو جدار الحماية لتقييد GRE الوارد على عناوين IP المصدر الخاصة بمراكز فرز السحابة المتوقعة فقط:

Cisco IOS
! Example upstream router ACL (Cisco IOS style)
ip access-list extended ALLOW-XC-GRE
permit gre host xXC_C1_OUTER_V4x host xBIGIP_A_OUTER_V4x
permit gre host xXC_C2_OUTER_V4x host xBIGIP_A_OUTER_V4x
permit gre host xXC_C1_OUTER_V4x host xBIGIP_B_OUTER_V4x
permit gre host xXC_C2_OUTER_V4x host xBIGIP_B_OUTER_V4x
deny gre any host xBIGIP_A_OUTER_V4x log
deny gre any host xBIGIP_B_OUTER_V4x log

عناوين IP الذاتية الداخلية (نظير BGP)

Section titled “عناوين IP الذاتية الداخلية (نظير BGP)”

خصّص عناوين IP داخلية (داخل نفق GRE) لتُشكّل جلسة BGP مع السحابة. يجب أن تتضمن allow-service القيمة tcp:179 (BGP) لإنشاء جلسة النظير. إضافة icmp:any على عناوين IP الذاتية الداخلية يتيح PMTUD واختبار إمكانية الوصول عبر النفق:

النفق C1-T1 — BIG-IP-A إلى xCENTER_1x:

tmsh
create net self xc-ddos-c1t1-inner-v4 \
vlan xc-ddos-c1t1-v4 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C1_T1_INNER_V4x/30
create net self xc-ddos-c1t1-inner-v6 \
vlan xc-ddos-c1t1-v6 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C1_T1_INNER_V6x/64

النفق C2-T1 — BIG-IP-A إلى xCENTER_2x:

tmsh
create net self xc-ddos-c2t1-inner-v4 \
vlan xc-ddos-c2t1-v4 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C2_T1_INNER_V4x/30
create net self xc-ddos-c2t1-inner-v6 \
vlan xc-ddos-c2t1-v6 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C2_T1_INNER_V6x/64

النفق C1-T2 — BIG-IP-B إلى xCENTER_1x:

tmsh
create net self xc-ddos-c1t2-inner-v4 \
vlan xc-ddos-c1t2-v4 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C1_T2_INNER_V4x/30
create net self xc-ddos-c1t2-inner-v6 \
vlan xc-ddos-c1t2-v6 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C1_T2_INNER_V6x/64

النفق C2-T2 — BIG-IP-B إلى xCENTER_2x:

tmsh
create net self xc-ddos-c2t2-inner-v4 \
vlan xc-ddos-c2t2-v4 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C2_T2_INNER_V4x/30
create net self xc-ddos-c2t2-inner-v6 \
vlan xc-ddos-c2t2-v6 \
traffic-group traffic-group-local-only \
allow-service add { tcp:179 icmp:any } \
address xBIGIP_C2_T2_INNER_V6x/64

استخدم imish لتهيئة BGP لنطاق المسار 0.

  1. أدخل imish لنطاق المسار 0:

    bash
    tmsh run /util imish -r 0
  2. أدخل وضع الامتياز ووضع التهيئة:

    imish
    localhost.localdomain[0]> enable
    localhost.localdomain[0]# configure terminal
  3. مثال على تهيئة BGP:

BIG-IP-A (router-id هو xBIGIP_A_OUTER_V4x، الجيران C1-T1 + C2-T1):

imish
router bgp xCUSTOMER_ASNx
no synchronization
bgp log-neighbor-changes
no auto-summary
bgp router-id xBIGIP_A_OUTER_V4x
bgp graceful-restart restart-time 120
redistribute kernel route-map route-to-cloud-ipv4
neighbor cloud peer-group
neighbor cloud remote-as xF5_XC_ASNx
neighbor cloud description cloud-peer-group
neighbor cloud password xBGP_PASSWORDx
neighbor cloud timers 10 30
neighbor cloud soft-reconfiguration inbound
neighbor cloud version 4
neighbor cloud capability graceful-restart
neighbor cloud send-community
neighbor cloud ttl-security hops 1
neighbor cloud maximum-prefix 10 warning-only
neighbor cloud prefix-list deny-all in
neighbor cloud prefix-list route-to-cloud-ipv4 out
neighbor xXC_C1_T1_INNER_V4x peer-group cloud
neighbor xXC_C1_T1_INNER_V4x description cloud-c1-t1-v4
neighbor xXC_C2_T1_INNER_V4x peer-group cloud
neighbor xXC_C2_T1_INNER_V4x description cloud-c2-t1-v4
address-family ipv6
redistribute kernel route-map route-to-cloud-ipv6
neighbor cloud activate
neighbor cloud soft-reconfiguration inbound
neighbor cloud capability graceful-restart
neighbor cloud prefix-list deny-all6 in
neighbor cloud prefix-list route-to-cloud-ipv6 out
neighbor xXC_C1_T1_INNER_V6x peer-group cloud
neighbor xXC_C1_T1_INNER_V6x description cloud-c1-t1-v6
neighbor xXC_C2_T1_INNER_V6x peer-group cloud
neighbor xXC_C2_T1_INNER_V6x description cloud-c2-t1-v6
exit-address-family
ip prefix-list deny-all deny 0.0.0.0/0 le 32
ip prefix-list route-to-cloud-ipv4 permit xPROTECTED_PREFIX_V4x
ipv6 prefix-list deny-all6 deny ::/0 le 128
ipv6 prefix-list route-to-cloud-ipv6 permit xPROTECTED_PREFIX_V6x
ip route xPROTECTED_NET_V4x xPROTECTED_MASK_V4x null0 201
ipv6 route xPROTECTED_PREFIX_V6x null0 201
route-map route-to-cloud-ipv4 permit 10
match ip address prefix-list route-to-cloud-ipv4
set origin igp
route-map route-to-cloud-ipv6 permit 10
match ipv6 address prefix-list route-to-cloud-ipv6
set origin igp

BIG-IP-B (router-id هو xBIGIP_B_OUTER_V4x، الجيران C1-T2 + C2-T2):

imish
router bgp xCUSTOMER_ASNx
no synchronization
bgp log-neighbor-changes
no auto-summary
bgp router-id xBIGIP_B_OUTER_V4x
bgp graceful-restart restart-time 120
redistribute kernel route-map route-to-cloud-ipv4
neighbor cloud peer-group
neighbor cloud remote-as xF5_XC_ASNx
neighbor cloud description cloud-peer-group
neighbor cloud password xBGP_PASSWORDx
neighbor cloud timers 10 30
neighbor cloud soft-reconfiguration inbound
neighbor cloud version 4
neighbor cloud capability graceful-restart
neighbor cloud send-community
neighbor cloud ttl-security hops 1
neighbor cloud maximum-prefix 10 warning-only
neighbor cloud prefix-list deny-all in
neighbor cloud prefix-list route-to-cloud-ipv4 out
neighbor xXC_C1_T2_INNER_V4x peer-group cloud
neighbor xXC_C1_T2_INNER_V4x description cloud-c1-t2-v4
neighbor xXC_C2_T2_INNER_V4x peer-group cloud
neighbor xXC_C2_T2_INNER_V4x description cloud-c2-t2-v4
address-family ipv6
redistribute kernel route-map route-to-cloud-ipv6
neighbor cloud activate
neighbor cloud soft-reconfiguration inbound
neighbor cloud capability graceful-restart
neighbor cloud prefix-list deny-all6 in
neighbor cloud prefix-list route-to-cloud-ipv6 out
neighbor xXC_C1_T2_INNER_V6x peer-group cloud
neighbor xXC_C1_T2_INNER_V6x description cloud-c1-t2-v6
neighbor xXC_C2_T2_INNER_V6x peer-group cloud
neighbor xXC_C2_T2_INNER_V6x description cloud-c2-t2-v6
exit-address-family
ip prefix-list deny-all deny 0.0.0.0/0 le 32
ip prefix-list route-to-cloud-ipv4 permit xPROTECTED_PREFIX_V4x
ipv6 prefix-list deny-all6 deny ::/0 le 128
ipv6 prefix-list route-to-cloud-ipv6 permit xPROTECTED_PREFIX_V6x
ip route xPROTECTED_NET_V4x xPROTECTED_MASK_V4x null0 201
ipv6 route xPROTECTED_PREFIX_V6x null0 201
route-map route-to-cloud-ipv4 permit 10
match ip address prefix-list route-to-cloud-ipv4
set origin igp
route-map route-to-cloud-ipv6 permit 10
match ipv6 address prefix-list route-to-cloud-ipv6
set origin igp

شرح إعدادات BGP الرئيسية:

  • timers 10 30 — إرسال إشارة حيّة كل 10 ثوانٍ، مهلة الاحتفاظ 30 ثانية. الإعداد الافتراضي (60 / 180) بطيء جدًا للتعافي من هجمات DDoS. نسّق قيم المؤقتات مع مركز العمليات الأمنية لمطابقة الطرفين.
  • ttl-security hops 1 — يُفعّل GTSM (RFC 5082). نظرًا لأن جلسات BGP تعمل عبر قفزة واحدة فوق نفق GRE، فإن ذلك يمنع انتحال BGP عن بُعد من خلال اشتراط قيمة TTL = 255 في حزم BGP الواردة.
  • maximum-prefix 10 warning-only — ضمان دفاع متعمق. حتى مع رفض قائمة البادئات الواردة لجميع المسارات، يُولّد هذا تحذيرًا إذا أرسل الجار بادئات بشكل غير متوقع.
  • redistribute kernel — يضخّ المسارات الساكنة null0 في BGP عبر خريطة المسار. البديل هو استخدام عبارات network الصريحة (مثل network xPROTECTED_PREFIX_V4x)، وهي أكثر دقة لأن البادئة الدقيقة فقط هي التي تُعلن بصرف النظر عن مسارات النواة الأخرى. كلا النهجين يعمل؛ يُعرض هنا redistribute kernel مع خريطة مسار صارمة لمرونة أكبر.

تضمن المسارات الساكنة null0 ذات المسافة الإدارية الأعلى (201) وجود البادئات في جدول توجيه النواة، حتى يمكن إعادة توزيعها إلى السحابة عبر BGP دون التأثير على التوجيه الطبيعي في ظروف عدم الهجوم. إذا كانت البادئة المحمية موجودة بالفعل في جدول التوجيه من مصدر آخر بمسافة إدارية أقل، فلن يكون مسار null0 نشطًا وقد تفشل إعادة التوزيع — تحقق باستخدام show ip route بعد التهيئة.