- Startseite
- DDoS
- BIG-IP Konfiguration
BIG-IP Konfiguration
- (Beispiel für Route Domain 0)
Alle nachstehenden Befehle werden in tmsh auf BIG-IP ausgeführt. Passen Sie Objektnamen und IP-Adressen nach Bedarf an.
Allgemeine Informationen zur GRE-Tunnel-Konfiguration auf BIG-IP finden Sie unter Configuring a GRE Tunnel Using BIG-IP. Für die erstmalige Einrichtung der gerouteten Konfiguration mit der Cloud siehe K000147949.
[root@bigip:Active]# tmshroot@(bigip)(cfg-sync Standalone)(Active)(/Common)(tmos)#Äußere Self-IPs
Abschnitt betitelt „Äußere Self-IPs“GRE-Endpunkte
Dies sind die IPs auf jeder BIG-IP-Einheit, die als GRE-Tunnel-
Endpunkte verwendet werden, typischerweise auf dem externen VLAN. Jede Einheit verfügt über eine eigene
nicht-floating äußere Self-IP (traffic-group-local-only):
BIG-IP-A:
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/64BIG-IP-B:
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/64GRE-Tunnel
Abschnitt betitelt „GRE-Tunnel“Jeder Tunnel verbindet eine BIG-IP-Einheit mit einem Cloud- Scrubbing-Center-Endpunkt. Erstellen Sie zwei Tunnel pro Einheit (jeweils einen zu jedem geografisch verteilten Scrubbing-Center), insgesamt vier logische Tunnel über das HA-Paar:
Tunnel C1-T1 — BIG-IP-A zu xCENTER_1x:
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_V6xTunnel C2-T1 — BIG-IP-A zu xCENTER_2x:
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_V6xTunnel C1-T2 — BIG-IP-B zu xCENTER_1x:
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_V6xTunnel C2-T2 — BIG-IP-B zu xCENTER_2x:
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_V6xTunnelnamen (xc-ddos-c1t1-v4 usw.) sind frei wählbar; verwenden Sie Ihre eigene
Namenskonvention.
Tunnel-MTU festlegen
Abschnitt betitelt „Tunnel-MTU festlegen“GRE-Kapselung erzeugt Overhead (24 Byte für äußeren IPv4-Header, 44 Byte für äußeren IPv6-Header). Ohne explizit festgelegte MTU werden Pakete nahe 1500 Byte fragmentiert oder verworfen. Legen Sie die Tunnel-MTU fest, um den Kapselungsoverhead zu berücksichtigen:
modify net tunnels tunnel xc-ddos-c1t1-v4 mtu 1476modify net tunnels tunnel xc-ddos-c1t1-v6 mtu 1456modify net tunnels tunnel xc-ddos-c1t2-v4 mtu 1476modify net tunnels tunnel xc-ddos-c1t2-v6 mtu 1456modify net tunnels tunnel xc-ddos-c2t1-v4 mtu 1476modify net tunnels tunnel xc-ddos-c2t1-v6 mtu 1456modify net tunnels tunnel xc-ddos-c2t2-v4 mtu 1476modify net tunnels tunnel xc-ddos-c2t2-v6 mtu 1456GRE-Anti-Spoofing (vorgelagerte ACLs)
Abschnitt betitelt „GRE-Anti-Spoofing (vorgelagerte ACLs)“GRE (IP-Protokoll 47) bietet keine Authentifizierung. Jeder, der das äußere IP-Paar kennt, kann Datenverkehr in den Tunnel einschleusen. Wenden Sie ACLs auf dem vorgelagerten Router oder der Firewall an, um eingehenden GRE-Verkehr auf ausschließlich die erwarteten Cloud-Scrubbing-Center-Quell-IPs zu beschränken:
! 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 logInnere Self-IPs (BGP-Peering)
Abschnitt betitelt „Innere Self-IPs (BGP-Peering)“Weisen Sie innere IP-Adressen (innerhalb des GRE-Tunnels) zu, die die
BGP-Sitzung mit der Cloud aufbauen. Der allow-service-Wert muss
tcp:179 (BGP) enthalten, damit die Peering-Sitzung hergestellt werden kann. Das Hinzufügen
von icmp:any bei den inneren Self-IPs ermöglicht PMTUD und Erreichbarkeitstests
durch den Tunnel:
Tunnel C1-T1 — BIG-IP-A zu xCENTER_1x:
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/64Tunnel C2-T1 — BIG-IP-A zu xCENTER_2x:
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/64Tunnel C1-T2 — BIG-IP-B zu xCENTER_1x:
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/64Tunnel C2-T2 — BIG-IP-B zu xCENTER_2x:
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/64Verwenden Sie imish, um BGP für Route Domain 0 zu konfigurieren.
-
imish für RD 0 aufrufen:
bash tmsh run /util imish -r 0 -
Privilegierten Modus und Konfigurationsmodus aufrufen:
imish localhost.localdomain[0]> enablelocalhost.localdomain[0]# configure terminal -
Beispiel-BGP-Konfiguration:
BIG-IP-A (router-id xBIGIP_A_OUTER_V4x, Nachbarn C1-T1 + C2-T1):
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 32ip prefix-list route-to-cloud-ipv4 permit xPROTECTED_PREFIX_V4x
ipv6 prefix-list deny-all6 deny ::/0 le 128ipv6 prefix-list route-to-cloud-ipv6 permit xPROTECTED_PREFIX_V6x
ip route xPROTECTED_NET_V4x xPROTECTED_MASK_V4x null0 201ipv6 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 igpBIG-IP-B (router-id xBIGIP_B_OUTER_V4x, Nachbarn C1-T2 + C2-T2):
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 32ip prefix-list route-to-cloud-ipv4 permit xPROTECTED_PREFIX_V4x
ipv6 prefix-list deny-all6 deny ::/0 le 128ipv6 prefix-list route-to-cloud-ipv6 permit xPROTECTED_PREFIX_V6x
ip route xPROTECTED_NET_V4x xPROTECTED_MASK_V4x null0 201ipv6 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 igpErläuterung der wichtigsten BGP-Einstellungen:
timers 10 30— Keepalive alle 10 s, Hold-Time 30 s. Der Standardwert (60 / 180) ist für DDoS-Mitigation-Failover zu langsam. Stimmen Sie die Timer-Werte mit dem SOC ab, damit beide Seiten übereinstimmen.ttl-security hops 1— Aktiviert GTSM (RFC 5082). Da die BGP-Sitzungen Single-Hop über den GRE-Tunnel sind, verhindert dies Remote-BGP-Spoofing durch die Anforderung TTL = 255 bei eingehenden BGP-Paketen.maximum-prefix 10 warning-only— Defense-in-Depth-Schutzmaßnahme. Auch wenn die eingehende Präfixliste alle Routen ablehnt, erzeugt dies eine Warnung, wenn der Peer unerwartet Präfixe sendet.redistribute kernel— Fügt dienull0-Statikrouten über die Route-Map in BGP ein. Eine Alternative ist die Verwendung expliziternetwork- Anweisungen (z. B.network xPROTECTED_PREFIX_V4x), die präziser sind, da nur das exakte Präfix angekündigt wird, unabhängig von anderen Kernel-Routen. Beide Ansätze funktionieren;redistribute kernelmit einer strikten Route-Map wird hier der Flexibilität halber gezeigt.
Die null0-Statikrouten mit höherer administrativer Distanz (201)
stellen sicher, dass die Präfixe in der Kernel-Routing-Tabelle vorhanden sind, sodass sie
über BGP an die Cloud weitergegeben werden können, ohne das
normale Routing unter normalen Bedingungen (ohne Angriff) zu beeinflussen. Wenn das geschützte Präfix
bereits aus einer anderen Quelle mit niedrigerer administrativer Distanz in der
Routing-Tabelle vorhanden ist, ist die null0-Route nicht aktiv und
die Weiterverteilung kann fehlschlagen — überprüfen Sie dies nach der
Konfiguration mit show ip route.