Skip to content

Instantly share code, notes, and snippets.

@XioNoX
Created February 16, 2018 23:39
Show Gist options
  • Save XioNoX/118375e60bb9ede6baf81545d1da6b05 to your computer and use it in GitHub Desktop.
Save XioNoX/118375e60bb9ede6baf81545d1da6b05 to your computer and use it in GitHub Desktop.
netflow sampling on junos
Variable:
set forwarding-options sampling instance pmacct family inet output inline-jflow source-address <routerLO>
set forwarding-options sampling instance pmacct family inet6 output inline-jflow source-address <routerLO>
set protocols bgp group Netflow local-address <routerLO>
set protocols bgp group Netflow peer-as <routerASN> #ibgp, pmacct accepts any AS#
set protocols bgp group Netflow local-as <routerASN>
MX > 104: set chassis fpc X sampling-instance pmacct
MX104 : set chassis afeb slot 0 sampling-instance pmacct
MX80 : set chassis tfeb slot 0 sampling-instance pmacct
----
set forwarding-options sampling instance pmacct input rate 1000
set forwarding-options sampling instance pmacct family inet output flow-server <collector> port 2100
set forwarding-options sampling instance pmacct family inet output flow-server <collector> version-ipfix template ipv4
set forwarding-options sampling instance pmacct family inet6 output flow-server <collector> port 2100
set forwarding-options sampling instance pmacct family inet6 output flow-server <collector> version-ipfix template ipv6
set forwarding-options family inet6 route-accounting
set services flow-monitoring version-ipfix template ipv4 flow-active-timeout 300
set services flow-monitoring version-ipfix template ipv4 flow-inactive-timeout 30
set services flow-monitoring version-ipfix template ipv4 template-refresh-rate seconds 60
set services flow-monitoring version-ipfix template ipv4 ipv4-template
set services flow-monitoring version-ipfix template ipv6 flow-active-timeout 300
set services flow-monitoring version-ipfix template ipv6 flow-inactive-timeout 30
set services flow-monitoring version-ipfix template ipv6 template-refresh-rate seconds 60
set services flow-monitoring version-ipfix template ipv6 ipv6-template
set protocols bgp group Netflow type internal
set protocols bgp group Netflow import BGP_reject
set protocols bgp group Netflow family inet any
set protocols bgp group Netflow family inet6 any
set protocols bgp group Netflow local-as no-prepend-global-as
set protocols bgp group Netflow neighbor <collector>
set groups external-links interfaces <*> unit <*> family inet sampling input
set groups external-links interfaces <*> unit <*> family inet sampling output
set groups external-links interfaces <*> unit <*> family inet6 sampling input
set groups external-links interfaces <*> unit <*> family inet6 sampling output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment