The following example shows how to collect MPLS traffic with IPv4 payloads.
Router(config)#flow monitor-map MPLS-IPv4-fmm
Router(config-fmm)#record mpls IPv4-fields labels 3
Router(config-fmm)#cache permanent
Router(config-fmm)#exit
Router(config)#interface HundredGigE 0/3/0/0
Router(config-if)#flow mpls monitor MPLS-IPv4-fmm sampler fsm ingress
The following example shows how to collect MPLS traffic with IPv6 payloads.
Router(config)#flow monitor-map MPLS-IPv6-fmm
Router(config-fmm)# record mpls IPv6-fields labels 3
Router(config-fmm)#cache permanent
Router(config-fmm)#exit
Router(config)#interface HundredGigE 0/3/0/0
Router(config-if)#flow mpls monitor MPLS-IPv6-fmm sampler fsm ingress
The following example shows how to configure the NetFlow monitor to collect MPLS packets
with IPv6 fields:
Router# config
Router(config)# flow exporter-map exp1
Router(config-fem)# version v9
Router(config-fem-ver)# options interface-table timeout 300
Router(config-fem-ver)# options sampler-table timeout 300
Router(config-fem-ver)# template data timeout 300
Router(config-fem-ver)# template options timeout 300
Router(config-fem-ver)# exit
Router(config-fem)# transport udp 12515
Router(config-fem)# source Loopback0
Router(config-fem)# destination 170.1.1.11
Router(config-fmm)# exit
Router(config)# flow monitor-map MPLS-IPv6-fmm
Router(config-fmm)# record mpls ipv6-fields labels 3
Router(config-fmm)# exporter exp1
Router(config-fmm)# cache entries 10000
Router(config-fmm)# cache permanent
Router(config-fmm)# exit
Router(config)# sampler-map FSM
Router(config-sm)# random 1 out-of 65535
Router(config-sm)# exit
Router(config)# interface HundredGigE 0/3/0/0
Router(config-if)# flow mpls monitor MPLS-IPv6-fmm sampler FSM ingress
The following example shows how to collect MPLS traffic with both IPv6 and IPv4 fields.
Router(config)# flow monitor-map MPLS-IPv4-IPv6-fmm
Router(config-fmm)# record mpls IPv4-IPv6-fields labels 3
Router(config-fmm)# cache permanent
Router(config-fmm)# exit
Router(config)# interface HundredGigE 0/3/0/0
Router(config-if)# flow mpls monitor MPLS-IPv4-IPv6-fmm sampler fsm ingress
Note
|
Flow records are exported using the Version 9 format.
|
Running Configuration
/* This configuration collects MPLS traffic with IPv4 payloads. */
flow monitor-map MPLS-IPv4-fmm
record mpls IPv4-fields labels 3
cache permanent
exit
interface HundredGigE 0/3/0/0
flow mpls monitor MPLS-IPv4-fmm sampler fsm ingress
/* This configuration collects MPLS traffic with IPv6 payloads. */
flow monitor-map MPLS-IPv6-fmm
record mpls IPv6-fields labels 3
cache permanent
exit
interface HundredGigE 0/3/0/0
flow mpls monitor MPLS-IPv6-fmm sampler fsm ingress
/* This configuration collects MPLS packets with IPv6 fields */
flow exporter-map exp1
version v9
options interface-table timeout 300
options sampler-table timeout 300
template data timeout 300
template options timeout 300
exit
transport udp 12515
source Loopback0
destination 170.1.1.11
exit
flow monitor-map MPLS-IPv6-fmm
record mpls ipv6-fields labels 3
exporter exp1
cache entries 10000
cache permanent
exit
sampler-map FSM
random 1 out-of 65535
exit
interface HundredGigE 0/3/0/0
flow mpls monitor MPLS-IPv6-fmm sampler FSM ingress
/* This configuration collects MPLS traffic with both IPv6 and IPv4 fields */
flow monitor-map MPLS-IPv4-IPv6-fmm
record mpls IPv4-IPv6-fields labels 3
cache permanent
exit
interface HundredGigE 0/3/0/0
flow mpls monitor MPLS-IPv4-IPv6-fmm sampler fsm ingress
Verification
Verify the flow monitor map data.
Router# show flow monitor-map MPLS-IPv6-fmm
Flow Monitor Map : MPLS-IPv6-fmm
-------------------------------------------------
Id: 1
RecordMapName: ipv4-raw
ExportMapName: expmap-dtxr2
CacheAgingMode: Normal
CacheMaxEntries: 65535
CacheActiveTout: 60 seconds
CacheInactiveTout: 120 seconds
CacheUpdateTout: N/A
CacheRateLimit: 2000
Verify the exporter map data.
Router# show flow exporter-map expmap-dtxr2
Flow Exporter Map : expmap-dtxr2
-------------------------------------------------
Id : 1
DestinationIpAddr : 170.1.1.11
VRFName : default
SourceIfName : Loopback0
SourceIpAddr : 10.200.58.1
DSCP : 10
TransportProtocol : UDP
TransportDestPort : 12515
Export Version: 9
Common Template Timeout : 300 seconds
Options Template Timeout : 300 seconds
Data Template Timeout : 600 seconds
Interface-Table Export Timeout : 300 seconds
Sampler-Table Export Timeout : 0 seconds
VRF-Table Export Timeout : 0 seconds
Verify the netflow cache record for MPLS packet.
Router# show flow monitor MPLS-IPv6-fmm cache format record location 0/0/CPU0
Thu Feb 25 05:14:11.474 IST
Cache summary for Flow Monitor FNF_MONITOR_MAP_MPLS2:
Cache size: 256000
Current entries: 1
Flows added: 74
Flows not added: 0
Ager Polls: 4418
- Active timeout 73
- Inactive timeout 0
- Immediate 0
- TCP FIN flag 0
- Emergency aged 0
- Counter wrap aged 0
- Total 73
Periodic export:
- Counter wrap 0
- TCP FIN flag 0
Flows exported 73
========== Record number: 1 ==========
LabelType : BGP
Prefix/Length : ::/0
Label1-EXP-S : 0-0-0
Label2-EXP-S : 24026-0-1
Label3-EXP-S : -
Label4-EXP-S : -
Label5-EXP-S : -
Label6-EXP-S : -
InputInterface : BE100
OutputInterface : Hu0/0/0/3.1001
ForwardStatus : Fwd
FirstSwitched : 00 06:33:48:047
LastSwitched : 00 06:33:54:838
ByteCount : 1002010
PacketCount : 1033
Dir : Ing
SamplerID : 1
IPv6SrcAddr : 3001:10::2
IPv6DstAddr : 1001:10::2
IPv6TC : 0
IPv6FlowLabel : 7
IPv6OptHdrs : 0x10
IPV6Prot : 59
L4SrcPort : 0
L4DestPort : 0
L4TCPFlags : 0
InputVRFID : default
OutputVRFID : default