[转]Network flow monitoring with Open vSwitch
2020-12-13 16:36
标签:code http tar com get strong With network virtualization, the software switches (such as Open vSwitch) on the servers act like the edge switches. So, to gain insights into the network flow behavior, it becomes important to have some sort of flow monitoring technique to analyze the traffic through these switches. NetFlow and sFlow are the two most widely used flow monitoring approaches. To monitor the flows, the switches need to be configured to export and send the traffic data to an analyzer (eg SolarWinds Real-Time NetFlow Analyzer and InMon sFlowTrend). The analyzer listens on a a particular port for the flow statistics data sent from the switches. In this article, I will explain how to configure an sFlow: or Now, you should be able to see on the sFlow analyzer the statistics for the traffic going through this OVS bridge. or to remove all the sFlow configurations from the bridge: You can also see the list of sFlow configurations using: NetFlow: Verify that you are getting the NetFlow statistics on the analyzer. To deconfigure NetFlow on You can also change the timeout once the NetFlow has been configured by using: Cheers! Credits: [转]Network flow monitoring with Open vSwitch,搜素材,soscw.com [转]Network flow monitoring with Open vSwitch 标签:code http tar com get strong 原文地址:http://www.cnblogs.com/popsuper1982/p/3800578.htmlOVS
to send the flow statistics to an analyzer for monitoring.
To begin, lets start the InMon sFlowTrend analyzer (or any other sFlow analyzer) on a host (h1). By default, sFlowTrend listens on port 6343. On the server (h2) running the open vswitch, we need to use ovs-vsctl
to configure the OVS as follows: $ COLLECTOR_IP=192.168.0.121
$ COLLECTOR_PORT=6343
$ AGENT=eth1
$ HEADER=128
$ SAMPLING=512
$ POLLING=10
COLLECTOR_IP
: IP of host h1
where the analyzer is running and listening on port COLLECTOR_PORT
. AGENT
: network interface on the host h2
which connects to the network on which host h1 is running. HEADER
: size (in bytes) of the packet header to be analyzed. SAMPLING
: specifies the sampling rate. Every nth packet will be sampled (with some deviation). POLLING
: polling time period in seconds.
Configure the OVS bridge ‘ovsbr1‘
(replace with the name of the OVS bridge on your setup): $ SFLOWUUID=`
sudo
ovs-vsctl -- --
id
=@sflow create sflow \
agent=${AGENT} target=\"${COLLECTOR_IP}:${COLLECTOR_PORT}\" \
header=${HEADER} sampling=${SAMPLING} polling=${POLLING} \
--
set
bridge virbr0 sflow=@sflow`
$
sudo
ovs-vsctl -- --
id
=@sflow create sflow agent=${AGENT} \
target=\"${COLLECTOR_IP}:${COLLECTOR_PORT}\" header=${HEADER} \
sampling=${SAMPLING} polling=${POLLING} \
--
set
bridge ovsbr1 sflow=@sflow
To stop the switch from sending these statistics and remove this configuration, do: $
sudo
ovs-vsctl remove bridge ovsbr1 sflow $SFLOWUUID
$
sudo
ovs-vsctl --
clear
Bridge ovsbr1 sflow
$
sudo
ovs-vsctl list sflow
Similarly, start a NetFlow collector on a host (h1
) and configure the OVS bridge on h2
as follows: $ COLLECTOR_IP=192.168.0.121
$ COLLECTOR_PORT=6343
$ TIMEOUT=10
$
sudo
ovs-vsctl --
set
Bridge ovsbr1 netflow=@nf -- --
id
=@nf \
create NetFlow targets=\"${COLLECTOR_IP}:${COLLECTOR_PORT}\" \
active-timeout=${TIMEOUT}
ovsbr1
, do: $
sudo
ovs-vsctl
clear
Bridge ovsbr1 netflow
$
sudo
ovs-vsctl
set
NetFlow ovsbr1 active_timeout=20
1. ovs-vsctl documentation
2. Open vSwitch config-cookbook
文章标题:[转]Network flow monitoring with Open vSwitch
文章链接:http://soscw.com/essay/36321.html