Why NetStream as IPFIX
On Huawei NE40E and NetEngine 8000 routers running VRP8, flow export is called NetStream. It can export NetFlow v5, v9, or IPFIX, but only v9 and IPFIX carry IPv6, BGP next-hop, and 32-bit interface indexes. Those are the fields EdgeWarden uses to identify the attacked destination, the protocol, and the port where the attack comes in.
You'll configure the board processing mode, the export format, the source and the 192.0.2.10:2055 collector, short timeouts, sampling with the rate announced to the collector, the edge interfaces, and IPv6. Then you'll verify everything on the router and in EdgeWarden.
The commands follow the NE40E V800R022 and NetEngine 8000 (V800R012 and V800R022) configuration guides. Where models or versions differ, the text calls it out.
Prerequisites
- NE40E or NetEngine 8000 running VRP8. Configuration is two-stage: nothing takes effect until
commit. - A stable source address, ideally the loopback (
198.51.100.1in the examples), with a route to the collector over the data plane. Flows are exported by the interface boards; the management port on the main control board doesn't forward that traffic. - SNMP v2c or v3 open to
192.0.2.10: interface names and capacity come from SNMP. - Port 2055/UDP open on the EdgeWarden server.
- A free slot in your license: each source IP counts as one exporter (Starter 1, Professional 2, Enterprise 10). Above the quota, flows are dropped before parsing, with a warning only in the service log.
Step 1: board processing mode
Every interface board with a sampled port needs to know who builds and exports the flows. In distributed mode, the board does it all:
system-view
slot 1
ip netstream sampler to slot self
quit
commitRepeat for every slot with a sampled interface. ipv6 netstream sampler to slot does the same thing: configure only one of them, or, if you configure both, use the same mode.
If a board can't process sampling, the NE40E and NetEngine 8000 guides describe centralized mode, where another board that supports it builds and exports the flows (ip netstream sampler to slot <slot>). Supported boards vary by model and release: on the NE40E V800R022, only the LPUI-51-L supports centralized mode, and the NE40E-X8AK doesn't support it.
To find your slot numbers, use display device. On the NE40E, the first number in the interface name is the slot (GigabitEthernet1/0/0 is in slot 1, as in the examples); other models number interfaces differently. On the NetEngine 8000 M14/M8, the guide uses slot 15 (the NetStream processing board) for GigabitEthernet0/1/0.
Step 2: format, source, and collector
ip netstream export version ipfix origin-as bgp-nexthop ttl
ip netstream export index-switch 32
ip netstream as-mode 32
ip netstream tcp-flag enable
ip netstream export source 198.51.100.1
ip netstream export host 192.0.2.10 2055
commitorigin-asexports the AS that originated the prefix. Withpeer-as, flows show the BGP neighbor's AS (your transit), not the origin.ttladds TTL to the record. Without it, the TTL variance detector has no data. EdgeWarden reads minimum TTL (IE 52) and logs a warning when no flow carries that field.index-switch 32widens the exported interface index from 16 to 32 bits and makes the NE export the system ifIndex, the same one SNMP uses. With the 16-bit default, the index is allocated by NetStream itself and doesn't match SNMP. Huawei only allows the switch with v9 or IPFIX, including for aggregated flows, if you use them.as-mode 32is required if your network or your neighbors use 4-byte ASNs.tcp-flag enablefeeds SYN flood detection. Huawei warns that it greatly increases the number of flows.- If the collector is only reachable through a VRF, append
vpn-instance <name>toexport host.
Prefer NetFlow v9? Use ip netstream export version 9 origin-as bgp-nexthop ttl. The formats are mutually exclusive, and EdgeWarden accepts both on the same port 2055.
Step 3: timeouts and templates
ip netstream timeout active interval-second 60
ip netstream timeout inactive 15
ip netstream export template timeout-rate 1
ip netstream export template option sampler
ip netstream export template option timeout-rate 1
commitThe active timeout sets how often a long-lived flow, such as an attack, gets exported, and it adds to EdgeWarden's analysis cycle (10 s by default). The default Huawei cites is 30 minutes, far too long for DDoS detection. 60 s is the usual recommendation; lower detects sooner and generates more export traffic. The interval-second option, in seconds, appears in the NE40E V800R022 and NetEngine 8000 (V800R012 and V800R022) guides. If ? on your release doesn't show it, use ip netstream timeout active 1: without the option, the value is in minutes.
Template timeout-rate is in minutes (the default Huawei cites is 30). After a collector restart, v9 and IPFIX data can only be decoded once the template arrives again; at 1 minute, the wait is short.
option sampler sends the collector the sampling rate for each interface and direction. That's what lets EdgeWarden show the rate as detectado (detected).
Step 4: sampling
ip netstream sampler fix-packets 1000 inbound
ip netstream sampler fix-packets 1000 outbound
commitfix-packets 1000 samples 1 out of every 1,000 packets; random-packets 1000 samples 1 in 1,000 on average, at a random position. Either works. Avoid fix-time: it samples by time and doesn't give a fixed 1:N ratio to scale the volume.
The global rate applies to all interfaces; a rate set under an interface takes precedence. Use the same rate in both directions: with different rates, one direction will match SNMP and the other won't. The minimum accepted depends on the board. On the NetEngine 8000 X, check it with display netstream sampler lower-limit; on other models, use ? after fix-packets.
Step 5: edge interfaces
Enable it on transit, IX, and CDN interfaces. To see attacks leaving from customers, include their interfaces as well.
interface GigabitEthernet1/0/0
ip netstream inbound
ip netstream outbound
quit
interface GigabitEthernet1/0/1.100
ip netstream inbound
ip netstream outbound
quit
commitNetStream enabled on the main interface does not collect sub-interface traffic. If transit lands on a sub-interface (GigabitEthernet1/0/1.100), enable it there.
Step 6: IPv6
IPv6 has its own commands and only exports as v9 or IPFIX. Use the same IPv4 source: EdgeWarden identifies the exporter by source IP, so the NE takes a single license slot and a single device record.
ipv6 netstream export version ipfix origin-as bgp-nexthop ttl
ipv6 netstream export index-switch 32
ipv6 netstream as-mode 32
ipv6 netstream export source 198.51.100.1
ipv6 netstream export host 192.0.2.10 2055
ipv6 netstream timeout active interval-second 60
ipv6 netstream timeout inactive 15
ipv6 netstream export template timeout-rate 1
ipv6 netstream export template option sampler
ipv6 netstream export template option timeout-rate 1
ipv6 netstream tcp-flag enable
ipv6 netstream sampler fix-packets 1000 inbound
ipv6 netstream sampler fix-packets 1000 outbound
interface GigabitEthernet1/0/0
ipv6 netstream inbound
ipv6 netstream outbound
quit
commitIPv6 has its own index-switch: without ipv6 netstream export index-switch 32, IPv6 flows carry the 16-bit index and interfaces may show up as if:N.
For ipv6 netstream sampler, use the same mode and value as IPv4: EdgeWarden applies one rate per exporter, and the NE exports both from the same source.
Verification on the router
display netstream global
display ip netstream statistics slot 1
display ipv6 netstream statistics slot 1
display ip netstream cache origin slot 1
display interface GigabitEthernet1/0/0
GigabitEthernet1/0/0 current state : UP (ifindex: 7)display netstream globalshows the global NetStream configuration in effect.- The
statisticscounters should increase between two runs. cache originlists flows still on the board, with interfaces, ASNs, and next-hop. If it's empty, the slot or the interface isn't sampling.- The
ifindexfromdisplay interfaceis the number that shows up in the flow onceindex-switch 32is in place.
Verification in EdgeWarden
On the server, first confirm that packets are arriving from the right source:
sudo tcpdump -i any -n -c 5 udp port 2055 and host 198.51.100.1
10:15:02.481233 ens18 In IP 198.51.100.1.50123 > 192.0.2.10.2055: UDP, length 1380
sudo journalctl -u flowspec-core -f- Under Configurações → Rede → Dispositivos (Settings → Network → Devices), add the NE with Endereço IP (IP address)
198.51.100.1(theexport source), Taxa de Amostragem de Flow (flow sampling rate)1000, and the SNMP settings. - In the list, the SNMP column should show Online and the Tráfego atual (current traffic) column should show a value instead of a dash.
- With
option sampler, the Amostragem (sampling) column switches to detectado (detected) once the options template arrives, and that value overrides the device record. If you seecadastro: 1:N (ignorado), update the record to the announced value. - Within 1 to 2 minutes, flows show up on the Flows screen. Filter by Exporter IP
198.51.100.1. Values are already multiplied by the sampling rate. - Validate the rate in the Fluxo × SNMP nas interfaces (flow vs. SNMP on interfaces) panel on the Análise do instante (instant analysis) screen: 1/N of SNMP means the rate is missing; N× means it was applied twice.
Common pitfalls
- Interfaces show as
if:N: the exported source differs from the registered IP, orindex-switch 32is missing (for IPv6,ipv6 netstream export index-switch 32) and the flow index doesn't match SNMP. - Wrong ASN in flows:
peer-asinstead oforigin-as. Re-enter bothexport versioncommands (IPv4 and IPv6) withorigin-asand check withdisplay current-configuration | include netstream. - Zeroed next-hop during mitigation: the NE40E and NetEngine 8000 X guides warn that with BGP FlowSpec or ACL redirection to a tunnel, inbound sampling exports next-hop and BGP next-hop as
0.0.0.0(or::) and the destination AS as 0. - Exporting via management: a collector reachable only through the management interface gets nothing; fix the route or use
vpn-instance. - Forgotten slot: an interface on a board without
ip netstream sampler to slotproduces no flows. - Only IPv4 on screen: the
ipv6 netstreamcommands are missing, globally or on the interface. - Idle detector: EdgeWarden logs a warning when a field isn't arriving. Without
ttlinexport version, the TTL variance detector has no data; some NE routers don't export the fragmentation fields, which leaves the Fragment Flood detector blind.
Anyone who can reach 2055/UDP can inject forged flows and poison detection. Restrict the port to your routers' IPs, for example with sudo ufw allow from 198.51.100.1 to any port 2055 proto udp, without leaving an open rule such as ufw allow 2055/udp.
Next steps
If any step fails, follow the No flows showing up in EdgeWarden? checklist. To tune rates and timeouts, read NetFlow and IPFIX sampling and timeouts without missing attacks. Running Juniper on the same edge? See IPFIX on the Juniper MX. Review ports and buffers in the installation guide, and see in Features how EdgeWarden uses these flows to detect attacks.