# Flowspec (RFC5575)
GoBGP supports [RFC5575](https://tools.ietf.org/html/rfc5575),
[RFC7674](https://tools.ietf.org/html/rfc7674),
[draft-ietf-idr-flow-spec-v6-06](https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06)
and [draft-ietf-idr-flowspec-l2vpn-03](https://tools.ietf.org/html/draft-ietf-idr-flowspec-l2vpn-03).
## Prerequisites
Assume you finished [Getting Started](https://github.com/osrg/gobgp/blob/master/docs/sources/getting-started.md).
## Contents
- [Configuration](#section0)
- [Add Flowspec routes through CLI](#section1)
## Configuration
To advertise flowspec routes, enumerate `ipv4-flowspec` to neighbor's
afi-safis like below.
```toml
[global.config]
as = 64512
router-id = "192.168.255.1"
[[neighbors]]
[neighbors.config]
neighbor-address = "10.0.255.1"
peer-as = 64512
[[neighbors.afi-safis]]
[neighbors.afi-safis.config]
afi-safi-name = "ipv4-flowspec"
[[neighbors.afi-safis]]
[neighbors.afi-safis.config]
afi-safi-name = "ipv6-flowspec"
[[neighbors.afi-safis]]
[neighbors.afi-safis.config]
afi-safi-name = "l2vpn-flowspec"
```
## Add Flowspec routes through CLI
CLI syntax to add ipv4/ipv6 flowspec rule is
```shell
% global rib add match then -a [ipv4-flowspec|ipv6-flowspec]
: { destination | source |
protocol ... | fragment | tcp-flags ... |
{ port | destination-port | source-port | icmp-type | icmp-code | packet-length | dscp } - ... }...
: ipip, sctp, unknown, igmp, tcp, egp, rsvp, pim, icmp, igp, udp, gre, ospf
: dont-fragment, is-fragment, first-fragment, last-fragment, not-a-fragment
: push, ack, urgent, fin, syn, rst
- : &?{<|>|=}
: { accept | discard | rate-limit | redirect