Advanced IPFIX: VRF, BGP next hop, tunnels and DPI in EdgeWarden

Which IPFIX fields feed VRF Visibility, Flow Explorer and Applications (DPI), what each vendor actually exports, and how to configure and verify it.

Beyond the 5-tuple

Addresses, ports, protocol and counters are enough to detect a volumetric attack. The optional IPFIX fields answer the next questions: which L3VPN customer is under attack, which BGP neighbor the attack comes in through, and whether that UDP/53 burst is legitimate queries or reflection. That decides where to mitigate and who to notify.

This guide shows which fields EdgeWarden reads, which screen each one shows up on, what each vendor exports according to its own documentation, and how to turn those fields on where support is confirmed.

Prerequisites

  • Basic IPFIX export already working, with the router added under Configurações → Rede → Dispositivos (Settings → Network → Devices) and SNMP enabled. If you're not there yet, start with the Juniper MX, Cisco or Huawei guides.
  • BGP routes on the exporting router. Without the route, ASN and next hop arrive as zero. EdgeWarden fills in the ASN from its ip2asn database, but it can't make up a next hop.
  • A maintenance window: the steps below change records and filters applied to interfaces.

Fields and screens

IPFIX fieldIEWhere it shows up in EdgeWarden
ingressVRFID / egressVRFID234 / 235VRF Visibility and Analisador de Rede (Network Analyzer)
bgpSourceAsNumber / bgpDestinationAsNumber16 / 17Flow Explorer (AS axis), Análise de AS (AS analysis) and Peering Analytics
bgpNextHopIPv4Address / bgpNextHopIPv6Address18 / 63Analisador de Rede, BGP Next Hop dimension
layer2SegmentId (VNI)351Analisador de Rede, Tipo Túnel and ID Túnel (tunnel type and ID) dimensions
dataLinkFrameSection315Aplicações (DPI) (Applications): TLS SNI, HTTP Host and DNS

Without IE 18 or 63, EdgeWarden falls back to the plain IP next hop (IE 15 or 62). In that case the value is the immediate next hop, not the neighbor that advertised the route.

Tunnels need no extra field. EdgeWarden classifies VxLAN (UDP 4789), GENEVE (UDP 6081), L2TP (UDP 1701), MPLS-in-UDP (UDP 6635), GRE and IP-in-IP from the outer header of any flow. IE 351 only adds the VNI; without it, the tunnel is still classified, with an empty ID.

What each vendor exports

A summary of what we checked in the official documentation. "Not documented" means we didn't find the field, not that it's definitely missing from your release.

PlatformVRF (IE 234/235)ASN and BGP next hopPacket section (IE 315)
Cisco IOS XE (Flexible NetFlow)Yes: match routing vrf input / outputYes: collect routingNot documented
Cisco IOS XRLikely: check the cacheYes, in the fixed recordASR 9000: only up to the L4 header
Juniper MX (inline J-Flow)Not in the templateYes: IE 16, 17, 18 and 63Yes, via inline monitoring (Junos 19.4R1+)
Huawei NE40E/NE8000Not confirmedYes: origin-as bgp-nexthopNot documented
MikroTik RouterOS v7NoNo; only the gateway fieldNo
  • Cisco IOS XE: the Flexible NetFlow command reference has no command for IE 315. collect ipv4 section header exports IE 313, which EdgeWarden ignores when the record already carries addresses, and IE 314 (section payload) isn't read. There's no DPI down this path.
  • Cisco IOS XR: Cisco's IPFIX examples for the ASR 9000 show InputVRFID, OutputVRFID, BGPNextHopV6 and origin ASN in the monitor cache. By default the record carries the origin AS; record ipv4 peer-as switches it to the peer AS. Keep the default: EdgeWarden expects the origin AS. ASR 9000 IPFIX 315 truncates the frame at the L4 header, works on ingress only, on 3rd- and 4th-generation line cards, and can't be enabled on an interface that already has IPv4, IPv6 or MPLS monitors: EdgeWarden rebuilds the 5-tuple, but there's no payload to pull SNI, Host or DNS from.
  • Huawei: ip netstream export version accepts route-distinguisher only with format 9, not with ipfix, and the documentation doesn't say which field carries the value. For ASN and next hop, use ip netstream export version ipfix origin-as bgp-nexthop ttl, as in the Huawei guide.
  • MikroTik: none of the /ip traffic-flow ipfix fields carries VRF, ASN or BGP next hop. gateway is the flow's next hop, and the ASN comes from EdgeWarden's ip2asn database.

Step 1: VRF, ASN and BGP next hop on Cisco IOS XE

Add the fields to the records from the Cisco guide. Cisco requires removing the monitor from every interface before changing the record; reapply it afterwards. The example shows one interface: repeat the removal and the reapply on every interface that has the monitor.

IOS XE: VRF and BGP fields in the records
interface GigabitEthernet0/0/1
 no ip flow monitor EW-MON-V4 sampler EW-SAMP input
 no ipv6 flow monitor EW-MON-V6 sampler EW-SAMP input
!
flow record EW-REC-V4
 match routing vrf input
 collect routing source as 4-octet
 collect routing destination as 4-octet
 collect routing next-hop address ipv4 bgp
!
flow record EW-REC-V6
 collect routing source as 4-octet
 collect routing destination as 4-octet
 collect routing next-hop address ipv6 bgp
!
interface GigabitEthernet0/0/1
 ip flow monitor EW-MON-V4 sampler EW-SAMP input
 ipv6 flow monitor EW-MON-V6 sampler EW-SAMP input
  • 4-octet exports the ASN in 4 bytes; without it the field is 2 bytes and can't hold 32-bit ASNs. Don't use peer: it swaps the origin AS for the peer AS and exports it in other fields (IE 128/129), which EdgeWarden doesn't read.
  • match routing vrf output has been around since IOS XE 3.8S, but it requires an output monitor. Combined with input, the same packet gets counted twice. Stick with the ingress VRF.
  • Cisco's VRF example uses an IPv4 record. If your platform accepts it, add match routing vrf input to EW-REC-V6 as well. If it rejects a line, remove just that line and check the fields with show flow record.

Step 2: accurate BGP next hop on Juniper MX

The MX IPFIX template already carries ASN and BGP next hop (IE 16, 17, 18 and 63). When the destination has several paths, though, the IP next hop (IE 15) and the output interface (IE 14) show the first path in the forwarding table, and on IPv6 they're zero, until you turn on nexthop-learning. The BGP next hop has the same problem with traffic load-balanced across several BGP peers: the MX reports the first one in the list. Starting in Junos 24.2R1, on the MX240, MX480, MX960, MX2010 and MX2020, multi-bgp-path reports the right neighbor, and it depends on nexthop-learning.

Junos: next-hop learning and multi-bgp-path
set services flow-monitoring version-ipfix template ew-ipv4 nexthop-learning enable
set services flow-monitoring version-ipfix template ew-ipv6 nexthop-learning enable
set services flow-monitoring version-ipfix template ew-ipv4 multi-bgp-path
set services flow-monitoring version-ipfix template ew-ipv6 multi-bgp-path
commit check
commit confirmed 10
commit

On releases before 24.2R1 or on other models, leave out the two multi-bgp-path lines and check support in Juniper's Feature Explorer. For IPv6, Juniper also requires ipv6-extended-attrib on the FPC flow table; the hierarchy is shown differently on different pages of Juniper's own documentation, so check it on your release. With the feature on, fragmentIdentification (IE 54) reports 0.

Step 3: packet section for DPI on Juniper MX

Inline monitoring (MX with MPCs from Junos 19.4R1; MPC10E and MPC11E from 20.4R1) exports the sampled packet in IE 315, clipped from the Ethernet header: up to 126 bytes on Junos OS, up to 256 on Junos OS Evolved. The example samples only DNS, where the queried name usually fits in the clip, and HTTP, where the Host only fits when the request line is short. It covers IPv4; for IPv6, repeat the terms in a family inet6 filter.

Junos: inline monitoring for DNS and HTTP
set services inline-monitoring template ew-im-tpl template-refresh-rate 60
set services inline-monitoring template ew-im-tpl option-template-refresh-rate 60
set services inline-monitoring template ew-im-tpl observation-domain-id 2
set services inline-monitoring instance ew-im template-name ew-im-tpl
set services inline-monitoring instance ew-im maximum-clip-length 126
set services inline-monitoring instance ew-im collector ew-col source-address 198.51.100.1
set services inline-monitoring instance ew-im collector ew-col destination-address 192.0.2.10
set services inline-monitoring instance ew-im collector ew-col destination-port 2055
set services inline-monitoring instance ew-im collector ew-col sampling-rate 1000
set firewall family inet filter EW-IM term dns from protocol udp
set firewall family inet filter EW-IM term dns from port 53
set firewall family inet filter EW-IM term dns then inline-monitoring-instance ew-im
set firewall family inet filter EW-IM term dns then accept
set firewall family inet filter EW-IM term http from protocol tcp
set firewall family inet filter EW-IM term http from destination-port 80
set firewall family inet filter EW-IM term http then inline-monitoring-instance ew-im
set firewall family inet filter EW-IM term http then accept
set firewall family inet filter EW-IM term resto then accept
set interfaces xe-0/0/0 unit 0 family inet filter input EW-IM
commit check
commit confirmed 10
commit
  • The resto term is mandatory: without it, the filter's implicit discard drops all other traffic. If the interface already has an input filter, add these terms to it instead of replacing it.
  • On Junos OS the rate is set per collector, and Juniper announces it in the option data record (IE 34). EdgeWarden keeps the rate per exporter and observation domain. observation-domain-id sets only the most significant byte of the domain (the router generates the other three); a value of its own, like the 2 in the example, helps keep the inline monitoring rate separate from the J-Flow one.
  • The TLS SNI usually sits beyond 126 bytes, and even 256 bytes doesn't always reach it. For real SNI coverage, use the Packet Sensor, or sFlow with a sampled header larger than the default 128 bytes if the device allows it.

Packets already sampled by inline J-Flow get counted again by inline monitoring. EdgeWarden can't tell that both records describe the same packet, so that router's DNS and HTTP volume goes up. Keep the filter narrow and check the Fluxo × SNMP nas interfaces (flow vs. SNMP on interfaces) card on the Análise do instante (instant analysis) screen.

Verification on the router

IOS XE: record and cache with VRF and BGP
show flow record EW-REC-V4
show flow monitor name EW-MON-V4 cache format record
Junos: inline monitoring statistics
show services inline-monitoring statistics fpc-slot 0

In the IOS XE cache, flows from VRF interfaces should show the ingress VRF and BGP next hop populated. On Junos, the command's counters should increase on every run.

Verification in EdgeWarden

  1. Within 1 to 2 minutes of the change, open the Flows screen and filter by exporter 198.51.100.1.
  2. In Analisador de Rede (Network Analyzer), group by VRF Ingress, BGP Next Hop and Tipo Túnel (tunnel type). Zero or empty across the board means the field is missing from the template.
  3. In VRF Visibility, register each numeric ID with a name, RD and customer. The screen splits traffic by instance.
  4. In Aplicações (DPI) (Applications), the Tipo (type) column shows TLS SNI, HTTP or DNS when the match came from the packet. DNS Cache means passive DNS.
  5. When the packet section arrives, the log records the line "IPFIX inline monitoring detectado". Follow it with journalctl -u flowspec-core -f.

Common pitfalls

  • Stale template on the collector: the new fields are only decoded after the new template reaches the collector. A short template refresh shortens the wait.
  • Egress interface in another VRF on the MX: according to Juniper, destination mask, destination AS, IP next hop (IE 15) and output interface are reported as zero.
  • Zero ASN without a full table: Flow Explorer and Análise de AS stay empty until the ip2asn database is imported.
  • Inline monitoring filter catching IPFIX: Juniper warns that sampling the IPFIX traffic itself creates a loop. Don't include port 2055 in the terms.
  • License quota: a different source-address for inline monitoring becomes another exporter and takes another slot.

Packet section carries real chunks of customer packets, including queried names. Restrict 2055/UDP to your routers' IPs and handle this data according to your privacy policy.

Next steps

If no flows arrive, follow the checklist in No flows showing up in EdgeWarden?. To compare with sFlow, which carries the raw header, see NetFlow v5, v9, IPFIX or sFlow?. For the base setup, see the Juniper MX, Cisco, Huawei and MikroTik guides. Review ports and buffers in the installation guide and see in Features how these fields feed detection.

Related articles

All articles

Want to see these flows in EdgeWarden?

Create your account in the Customer area and generate the demo license: 7 days with every Enterprise feature, on your own server. Then follow the installation guide to bring up the collector.