Support Support Downloads Knowledge Base Service Request Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[QFX] Example - How to send sFlow packets using mgmt_junos non-default routing instance

0

0

Article ID: KB35372 KB Last Updated: 20 Dec 2019Version: 1.0
Summary:

This article provides an example configuration on how to send sFlow packets using the mgmt_junos non-default routing instance. It was tested on a QFX10016 chassis running Junos version 18.1R3-S7.1.


 
Solution:

Topology:

SW1 is sending regular traffic through interface xe-0/0/0.0 of QFX10016.


 

Configuration:

Commands on QFX10016 applicable to the goal:

set interfaces em0 unit 0 family inet address 10.85.151.157/25
set routing-instances mgmt_junos routing-options static route 0.0.0.0/0 next-hop 10.85.151.129 <<< default route to send traffic in non-default management routing instance
set system management-instance <<< associate em0 to mgmt_junos
set protocols sflow polling-interval 5 <<< interval in seconds the switch will send sampled packets to the collector
set protocols sflow sample-rate ingress 4096 <<< number of egress or ingress packets out of which one packet is sampled

set protocols sflow source-ip 10.85.151.157 <<< em0.0 interface used to source sFlow packets
set protocols sflow collector 10.85.208.29 <<< target device with sFlow monitoring software
set protocols sflow interfaces xe-0/0/0.0 <<< specific QFX10016 interface from which packets will be sampled

By default, Junos will use the default routing instance to send sFlow packets. To override this, a static route is created with the destination IP of the collector and the next hop of the mgmt_junos routing table.

set routing-options static route 10.85.208.29/32 next-table mgmt_junos.inet.0

After committing the configuration, the routes are installed.

root@QFX10016> show route 10.85.208.29

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.85.208.29/32    *[Static/5] 4d 22:59:46
                      to table mgmt_junos.inet.0

mgmt_junos.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0          *[Static/5] 4d 23:02:33
                    > to 10.85.151.129 via em0.0
 

Verification:

When monitoring the em0 interface, the packets are sent properly with the default sFlow destination port 6343.

root@QFX10016> monitor traffic interface em0 no-resolve size 9000 detail matching udp
Address resolution is OFF.
Listening on em0, capture size 9000 bytes

19:26:59.668741 Out IP (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto: UDP (17), length: 408) 10.85.151.157.62708 > 10.85.208.29.6343: UDP, length 380
19:27:04.748652 Out IP (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto: UDP (17), length: 408) 10.85.151.157.62708 > 10.85.208.29.6343: UDP, length 380
19:27:09.567461 Out IP (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto: UDP (17), length: 408) 10.85.151.157.62708 > 10.85.208.29.6343: UDP, length 380
19:27:14.634301 Out IP (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto: UDP (17), length: 408) 10.85.151.157.62708 > 10.85.208.29.6343: UDP, length 380
Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Security Alerts and Vulnerabilities

Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search