Flowspec (Global IPv4/6PE w/ Redirect)
Last updated
Last updated
Topology: ine-spv4
Load flowspec.global.redir.init.cfg
R1 and R7 are all dual-stacked internet peers in the global table. IPv6 uses 6PE in the core.
All flowspec BGP peerings are already pre-established.
R8 is an “analysis box.” Your task is to redirect DDoS traffic sourced from 1.1.1.1/32 and 2001:1::1/128 to R8 (8.8.8.8 and 2001:8::8) using flowspec. XR1 is the flowspec controller.
Flowspec can not only drop/police traffic, but it can redirect traffic. This is very useful for designs in which you have a DDoS analysis device. Instead of just simply dropping the traffic, you can redirect traffic to this analysis box.
To do so, we simply use a “redirect” action on the policy-map, instead of a “drop” or “police” action. First we define the traffic (sourced from R1):
Then we define the “redirect” action in the policy-map:
Finally, the service-policy is applied to the flowspec process:
On R2, notice that the flowspec NLRIs now have a nexthop. Previously, these all had a nexthop of 0.0.0.0, because the action was to drop the traffic.
We can verify in the flowspec table on R2 that the action is now to redirect to this nexthop address, instead of dropping the traffic:
If we ping 7.7.7.7 from R1, we should see hits on the IPv4 flowspec policy:
Now R2 shows 3 hits for the IPv4 flowspec policy:
Additionally, we see ACL log entries on R8, proving that it received the traffic. (An ACL was applied to Gi2.58 in the initial config file). Use term mon on R8, or show logging.
Notice that on R1, the pings time out completely. The packet is not copied, as in R-SPAN. Instead it is literally redirected to R8.
Let’s try it with IPv6 now:
We again see logs on R8:
Note that on version 17.x I found the pings actually worked. This must be a bug. But on 16.9.8 the IPv6 redirect is working properly.