Introduction
Ce document décrit comment configurer le protocole BGP (Border Gateway Protocol) IPv6 Flowspec sur ASR1K.
Conditions préalables
Conditions requises
Cisco recommande que vous ayez une connaissance de ce sujet :
- Indépendant de la plate-forme
Components Used
Les informations contenues dans ce document sont basées sur les versions de matériel et de logiciel suivantes :
- IOS-XE
- ASR1000
- ASR9K
- ASR1K
- BGP
- Flowspec
- IPv6
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. Si votre réseau est en ligne, assurez-vous de bien comprendre l’incidence possible des commandes.
Informations générales
Flowspec spécifie des procédures pour la distribution des règles de spécification de flux via BGP et définit la procédure pour encoder les règles de spécification de flux en tant que Border Gateway Protocol Network Layer Reachability Information (BGP NLRI) qui peut être utilisé dans n'importe quelle application. Il définit également les applications destinées au filtrage de paquets afin d'atténuer les attaques de déni de service (distribuées).
Limites
Voici les limites de la configuration :
- Une combinaison de familles d'adresses n'est pas autorisée dans les règles de spec de flux.
- Dans un scénario de correspondance multiple, seule la première règle d'espace de flux correspondante est appliquée.
- Un maximum de 3000 règles de flux est pris en charge par système.
Configuration
Dans cet exemple, nous avons configuré ASR9K en tant que contrôleur et ASR1K en tant que client PE, RR et Flowspec.
Il s'agit de la configuration minimale requise pour que le protocole Flowspec IPv6 fonctionne.
On controller to push the policy to PE/client:
class-map type traffic match-all FLOWSPEC
match destination-address ipv6 2001:db8::/32 <<<<< Match destination address/subnet.
end-class-map
!
policy-map type pbr FS_P
class type traffic FLOWSPEC <<<<< Apply class-map under policy-map.
drop
!
flowspec
address-family ipv4
service-policy type pbr FSP_V4
!
address-family ipv6
service-policy type pbr FS_P <<<<< Apply policy-map inside Flowspec under AF.
!
On PE/client is to enable IPv6 flowspec AF under BGP.
address-family ipv6 flowspec <<<<< Under ipv6 flowspec AF, activate the neighbor.
neighbor 10.192.202.5 activate
neighbor 10.192.202.5 validation off
To apply the flowspec policy on interface, "local-install interface-all" command is must under flowspec.
flowspec
local-install interface-all <<<<< Push the policy on interface.
- En fonction de la configuration du contrôleur, tout trafic destiné à 2001:db8::/32 doit être abandonné conformément à la stratégie.
- Désactivez la validation pour le voisin sous ipv6 address-family de sorte que ASR1K ne vérifie pas le saut suivant.
- Idéalement, si la stratégie est en action, le compteur est visible dans le contrôleur, mais si vous voulez le voir sur un autre périphérique, installez la stratégie flowspec sur toutes les interfaces utilisateur pour lesquelles la commande local-install interface-all est requise sous flowspec.
Défis lors du dépannage
- Si le réseau sous-jacent est IPv4 et que BGP flow spec s'exécute pour IPv6, un problème de contrôle de validation se produit sur chaque saut et entraîne un problème pour la politique IPv6 Flowspec. Par conséquent, conservez la validation pour que le voisin ne vérifie pas la validation.
- À l'exception d'un contrôleur, vous ne pouvez pas voir le compteur de correspondance/d'action de la stratégie de débordement. Afin de vérifier les compteurs, local-install interface-all doit être sous Flowspec (sous AF). Cette commande pousse la configuration de la stratégie de spécification de flux sur toutes les interfaces d'un périphérique pour les familles d'adresses IPv4 et IPv6, et sur les interfaces d'une instance VRF.
Diagramme du réseau
+----------------+ +-----------------+ +------------------+ +-----------------+
| | | | | | | |
| Controller +--------------+ PE/RR1 +------------+ PE/RR2 +-------------+ End-PE |
| ASR9K | | CRR01 | | CRR02 | | DCPR01 |
+----------------+ +-----------------+ +------------------+ +-----------------+
Configurations
Cette configuration est basée sur le schéma de réseau, identique à votre configuration.
Controller:
RP/0/RSP0/CPU0:Controller# show running-config
Mon Apr 8 16:33:36.578 UTC
Building configuration...
!! IOS XR Configuration 5.3.4
!! Last configuration change at Wed Apr 3 17:34:59 2019 by admin
!
hostname Controller
cdp
cdp advertise v1
!
class-map type traffic match-all FLOWSPEC
match destination-address ipv6 2001:db8::/32
end-class-map
!
class-map type traffic match-all V4_FLOWSPEC
match source-address ipv4 102.102.102.102 255.255.255.255
end-class-map
!
policy-map type pbr FS_P
class type traffic FLOWSPEC
drop
!
class type traffic class-default
!
end-policy-map
!
policy-map type pbr FSP_V4
class type traffic V4_FLOWSPEC
set dscp ef
!
class type traffic class-default
!
end-policy-map
!
interface Loopback0
ipv4 address 10.192.202.5 255.255.255.255
!
interface Loopback100
ipv4 address 102.102.102.102 255.255.255.255
ipv6 address 2001:db8::1/32
!
interface TenGigE0/0/0/0
ipv4 address 10.10.12.1 255.255.255.0
ipv6 address 2001:10:10:12::1/64
!
route-policy ALL
pass
end-policy
!
router static
address-family ipv4 unicast
203.202.143.33/32 TenGigE0/0/0/0
!
address-family ipv6 unicast
2003::/64 2001:10:10:12::2
!
!
router ospfv3 1
area 0
interface TenGigE0/0/0/0
network point-to-point
!
!
!
router bgp 64696
bgp router-id 10.192.202.5
address-family ipv4 unicast
network 102.102.102.102/32
!
address-family vpnv4 unicast
!
address-family ipv4 flowspec
!
address-family ipv6 flowspec
!
neighbor 203.202.143.33
remote-as 7474
ebgp-multihop 10
update-source Loopback0
address-family ipv4 unicast
route-policy ALL in
route-policy ALL out
!
address-family vpnv4 unicast
!
address-family ipv4 flowspec
route-policy ALL in
route-policy ALL out
!
address-family ipv6 flowspec
route-policy ALL in
route-policy ALL out
!
!
!
flowspec
local-install interface-all
address-family ipv4
service-policy type pbr FSP_V4
!
address-family ipv6
service-policy type pbr FS_P
!
!
end
PE/RR1:
CRR01#show running-config
Building configuration...
!
ipv6 unicast-routing
mpls label protocol ldp
!
spanning-tree extend system-id
flowspec
local-install interface-all
diagnostic bootup level minimal
!
interface Loopback0
ip address 203.202.143.33 255.255.255.255
ip ospf 1 area 0
!
interface Loopback1010
no ip address
ipv6 address 2001:DB8::10/32
!
interface TenGigabitEthernet0/0/0
ip address 10.10.12.2 255.255.255.0
ip ospf network point-to-point
cdp enable
ipv6 address 2001:10:10:12::2/64
!
interface TenGigabitEthernet0/0/3
ip address 10.10.23.2 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
cdp enable
ipv6 address 2003::1/64
mpls ip
!
router ospf 1
mpls ldp autoconfig
!
router bgp 7474
bgp router-id 203.202.143.33
bgp log-neighbor-changes
neighbor 10.192.202.5 remote-as 64696
neighbor 10.192.202.5 ebgp-multihop 10
neighbor 10.192.202.5 update-source Loopback0
neighbor 2001:10:10:12::1 remote-as 64696
neighbor 203.202.143.44 remote-as 7474
neighbor 203.202.143.44 update-source Loopback0
!
address-family ipv4
neighbor 10.192.202.5 activate
no neighbor 2001:10:10:12::1 activate
neighbor 203.202.143.44 activate
neighbor 203.202.143.44 route-reflector-client
exit-address-family
!
address-family ipv4 flowspec
neighbor 10.192.202.5 activate
neighbor 203.202.143.44 activate
neighbor 203.202.143.44 send-community both
neighbor 203.202.143.44 route-reflector-client
exit-address-family
!
address-family ipv6
neighbor 10.192.202.5 activate
neighbor 203.202.143.44 activate
neighbor 203.202.143.44 route-reflector-client
neighbor 203.202.143.44 send-label
exit-address-family
!
address-family ipv6 flowspec
neighbor 10.192.202.5 activate
neighbor 10.192.202.5 validation off
neighbor 203.202.143.44 activate
neighbor 203.202.143.44 send-community both
neighbor 203.202.143.44 route-reflector-client
neighbor 203.202.143.44 next-hop-self
exit-address-family
!
ip route 10.192.202.5 255.255.255.255 10.10.12.1
!
!
ipv6 route 2001:DB8::1/128 2001:10:10:12::1
!
end
PE/RR2:
CRR02#show running-config
Building configuration...
Current configuration : 7227 bytes
!
! Last configuration change at 18:21:29 UTC Mon Apr 8 2019
!
hostname CRR02
!
boot-start-marker
boot system flash bootflash:asr1000rpx86-universalk9.16.10.01a.SPA.bin
boot-end-marker
!
ipv6 unicast-routing
multilink bundle-name authenticated
!
spanning-tree extend system-id
flowspec
diagnostic bootup level minimal
!
interface Loopback0
ip address 203.202.143.44 255.255.255.255
ip ospf 1 area 0
!
interface TenGigabitEthernet1/0/0
ip address 10.10.23.3 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
cdp enable
ipv6 address 2003::2/64
mpls ip
!
interface TenGigabitEthernet1/0/1
ip address 10.10.34.3 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
cdp enable
!
router ospf 1
mpls ldp autoconfig
!
router bgp 7474
bgp router-id 203.202.143.44
bgp log-neighbor-changes
neighbor 203.202.143.33 remote-as 7474
neighbor 203.202.143.33 update-source Loopback0
neighbor 203.202.143.45 remote-as 7474
neighbor 203.202.143.45 update-source Loopback0
!
address-family ipv4
neighbor 203.202.143.33 activate
neighbor 203.202.143.45 activate
exit-address-family
!
address-family ipv4 flowspec
neighbor 203.202.143.33 activate
neighbor 203.202.143.45 activate
neighbor 203.202.143.45 send-community both
neighbor 203.202.143.45 route-reflector-client
exit-address-family
!
address-family ipv6
neighbor 203.202.143.33 activate
neighbor 203.202.143.33 send-label
exit-address-family
!
address-family ipv6 flowspec
neighbor 203.202.143.33 activate
neighbor 203.202.143.33 validation off
neighbor 203.202.143.45 activate
neighbor 203.202.143.45 send-community both
neighbor 203.202.143.45 route-reflector-client
exit-address-family
!
ipv6 route 2001:10:10:12::/64 2003::1
ipv6 route 2001:DB8::1/128 2003::1
!
end
End-PE:
DCPR01#show running-config
Building configuration...
!
hostname DCPR01
!
subscriber templating
!
ipv6 unicast-routing
!
flowspec
diagnostic bootup level minimal
!
interface Loopback0
ip address 203.202.143.45 255.255.255.255
ip ospf 1 area 0
!
interface TenGigabitEthernet1/3/0
ip address 10.10.34.4 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
cdp enable
ipv6 address 2001::1/64
!
router ospf 1
mpls ldp autoconfig
!
router bgp 7474
bgp router-id 203.202.143.45
bgp log-neighbor-changes
neighbor 203.202.143.44 remote-as 7474
neighbor 203.202.143.44 update-source Loopback0
!
address-family ipv4 flowspec
neighbor 203.202.143.44 activate
exit-address-family
!
address-family ipv6 flowspec
neighbor 203.202.143.44 activate
neighbor 203.202.143.44 validation off
exit-address-family
!
ipv6 route ::/0 TenGigabitEthernet1/3/0
!
end
Vérification
PE/RR2:
CRR02#ping 2001:db8::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:DB8::1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
CRR02#
Controller:
RP/0/RSP0/CPU0:Controller#show bgp ipv6 flowspec
Mon Apr 8 17:55:17.041 UTC
BGP router identifier 10.192.202.5, local AS number 64696
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0x0 RD version: 20
BGP main routing table version 20
BGP NSR Initial initsync version 0 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> Dest:2001:db8::/0-32/56
:: 0 i
Processed 1 prefixes, 1 paths
RP/0/RSP0/CPU0:Controller#show flowspec ipv6 detail
Mon Apr 8 17:55:36.786 UTC
AFI: IPv6
Flow :Dest:2001:db8::/0-32
Actions :Traffic-rate: 0 bps (policy.1.FS_P.FLOWSPEC)
Statistics (packets/bytes)
Matched : 14/1652
Dropped : 14/1652
RP/0/RSP0/CPU0:BGL14.1.J.05-ASR-9000-1#
PE/RR1:
CRR01#show bgp ipv6 flowspec
BGP table version is 2, local router ID is 203.202.143.33
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> Dest:2001:DB8::/0-32
:: 0 64696 i
CRR01#
CRR01#show flowspec ipv6 detail
AFI: IPv6
Flow :Dest:2001:DB8::/0-32
Actions :Traffic-rate: 0 bps (bgp.1)
Statistics (packets/bytes)
Matched : 4/456
Dropped : 4/456
CRR01#
Dépannage
Il n'existe actuellement aucune information de dépannage spécifique pour cette configuration.
Astuce : Si vous ouvrez un dossier avec 3.16.5S et que vous appuyez sur l'ID de bogue CSCva55510. Bien qu'il ne soit pas documenté dans le bogue, il s'applique à IPv6. Ceci est confirmé à partir de l'unité BGP ASR1K et est validé. Autre bogue CSCvp18767
est également classé pour la commande show qui est corrigée dans 16.12.1, donc mieux utiliser cette version. Cependant, IPv6 flow spec peut fonctionner dans n'importe quelle version 16.x.