[ovs-discuss] Mirroring works only for layer2 traffic.

Manik Sidana maniksidana019 at gmail.com
Fri May 8 12:48:05 UTC 2015


Hi Aj Nouri,

I still have some doubts.
When you add eth1,eth2 and eth3 to your bridge, then only your OVS bridge
should have an IP address. Thus pinging eth1 and eth2 has no meaning.
Any ping,ssh,L3 traffic should be directed to IP address of your bridge.
What you can do is, you can download a packet generator and generate L3
traffic form eth1 and check whether it gets dumped on eth3.

[Please correct me if I am wrong]

Thanks
Manik Sidana


On Sat, May 2, 2015 at 10:23 PM, AJ NOURI <ajn.bin at gmail.com> wrote:

> 1) You are right Manik, I have just pasted the wrong code, in fact I have
> used the following (without the brackets):
> select-dst-port=@eth1, at eth2 select-src-port=@eth1, at eth2 output-port=@eth3
> 2) I used the comand provided by openvswitch QA:
>
> http://git.openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=blob_plain;f=FAQ;hb=HEAD
> 3) The tested scenario is a layer2 switch, so I have supposed no need to
> set IP to the bridge.
>
> I have tried your version with the square brackets and assiged an IP
> address to br0, still only layer2 traffic:
>
> ## Monitoring station connected to eth3:
> tcpdump -i eth0
> 12:30:51.833391 ARP, Request who-has 192.168.1.1 tell 192.168.1.4, length
> 46
> 12:30:53.837238 ARP, Request who-has 192.168.1.1 tell 192.168.1.4, length
> 46
> 12:31:01.236287 CDPv2, ttl: 180s, Device-ID 'R3', length 322
> 12:31:19.427126 CDPv2, ttl: 180s, Device-ID 'R4', length 291
>
> ### Traffic generated between eth1 and eth2:
> - ARP traffic shows up when I try to ping a non existing ip (192.168.1.1)
> from eth1(connected to 192.168.1.3) to eth2 (connected to 192.168.1.4).
> - CDP is a layer 2 discovery protocol exchanged regularly between Cisco
> devices.
> - For layer 3 traffic, I generate ping, telnet and ssh between the two
> devices connected to eth1 and eth2 and it works perfectly.
>
>
>
> On Sat, May 2, 2015 at 5:29 PM, Manik Sidana <maniksidana019 at gmail.com>
> wrote:
>
>> Hi Aj Nouri,
>>
>> I have some doubts on the mirror that you have created
>> 1) You have specified only eth1 as dst-port/src-port.
>> 2) Why have you specified "-- --id=@eth3 get Port eth3" when you intend
>> to mirror only eth1 and eth2 traffic ?
>> 3) There's no IP on eth1,eth2,eth3 and br0. I think you are using some
>> packet generator internally on the machine itself.
>>
>>
>> I think you should re-create your mirror as below
>> ovs-vsctl -- set Bridge br0 mirrors=@m \
>>  -- --id=@eth1 get Port eth1 \
>>  -- --id=@eth2 get Port eth2 \
>>  -- --id=@eth3 get Port eth3 \
>>  -- --id=@m create Mirror name=e1e2toe3 select-dst-port=[@eth1, at eth2]
>> select-src-port=[@eth1, at eth2] output-port=@eth3
>> I would also suggest you to enable promiscuous mode on eth3 using
>> "ifconfig eth3 promisc"
>> If it still doesn't works, please share the kind of traffic that you are
>> generating.
>>
>>
>> On Sat, May 2, 2015 at 6:44 PM, AJ NOURI <ajn.bin at gmail.com> wrote:
>>
>>> Hi Manik, thanks for your reply.
>>>
>>> ###
>>> *sudo ovs-ofctl dump-flows br0*
>>> NXST_FLOW reply (xid=0x4):
>>>  cookie=0x0, duration=2954.754s, table=0, n_packets=641, n_bytes=76685,
>>> idle_age=4, priority=0 actions=NORMAL
>>>
>>> ###
>>> *sudo ovs-ofctl show br0*
>>> OFPT_FEATURES_REPLY (xid=0x2): dpid:0000080027a8d04b
>>> n_tables:254, n_buffers:256
>>> capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
>>> actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src
>>> mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
>>>  2(eth3): addr:08:00:27:b9:97:65
>>>      config:     0
>>>      state:      0
>>>      current:    1GB-FD COPPER AUTO_NEG
>>>      advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      speed: 1000 Mbps now, 1000 Mbps max
>>>  4(eth1): addr:08:00:27:a8:d0:4b
>>>      config:     0
>>>      state:      0
>>>      current:    1GB-FD COPPER AUTO_NEG
>>>      advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      speed: 1000 Mbps now, 1000 Mbps max
>>>  5(eth2): addr:08:00:27:e9:fa:c9
>>>      config:     0
>>>      state:      0
>>>      current:    1GB-FD COPPER AUTO_NEG
>>>      advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      supported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG
>>>      speed: 1000 Mbps now, 1000 Mbps max
>>>  LOCAL(br0): addr:08:00:27:a8:d0:4b
>>>      config:     PORT_DOWN
>>>      state:      LINK_DOWN
>>>      speed: 0 Mbps now, 0 Mbps max
>>> OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
>>>
>>> ###
>>> *sudo ovs-vsctl list bridge*
>>> _uuid               : 79b9be3c-8722-4427-9c23-42408094d04c
>>> controller          : []
>>> datapath_id         : "0000080027a8d04b"
>>> datapath_type       : ""
>>> datapath_version    : "2.3.90"
>>> external_ids        : {}
>>> fail_mode           : []
>>> flood_vlans         : []
>>> flow_tables         : {}
>>> ipfix               : []
>>> mcast_snooping_enable: false
>>> mirrors             : [56e727b0-508e-4291-a3cf-a1501fb83f2b]
>>> name                : "br0"
>>> netflow             : []
>>> other_config        : {}
>>> ports               : [0fa3fcfc-24fd-4094-9586-81652d418e19,
>>> a6bac80c-7ec7-408b-be95-00e70b768cd0, a789b92d-c686-4bd4-bec5-3abc0458a83c,
>>> eacc6f53-4b0c-4c1b-bee6-b16167cd237a]
>>> protocols           : []
>>> rstp_enable         : false
>>> rstp_status         : {}
>>> sflow               : []
>>> status              : {}
>>> stp_enable          : false
>>>
>>> ###
>>> *sudo ovs-vsctl show*
>>> 922ea05c-7625-4978-b3ce-7ca3558a05ef
>>>     Bridge "br0"
>>>         Port "eth3"
>>>             Interface "eth3"
>>>         Port "eth2"
>>>             Interface "eth2"
>>>         Port "eth1"
>>>             Interface "eth1"
>>>         Port "br0"
>>>             Interface "br0"
>>>                 type: internal
>>>     ovs_version: "2.3.90"
>>>
>>> ###
>>> *ifconfig -a*
>>> br0       Link encap:Ethernet  HWaddr 08:00:27:a8:d0:4b
>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>           RX packets:0 errors:0 dropped:6 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:0
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> eth0      Link encap:Ethernet  HWaddr 08:00:27:6a:b1:b6
>>>           UP BROADCAST MULTICAST  MTU:1500  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>> eth1      Link encap:Ethernet  HWaddr 08:00:27:a8:d0:4b
>>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>           RX packets:254 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:25158 (25.1 KB)  TX bytes:231 (231.0 B)
>>>
>>> eth2      Link encap:Ethernet  HWaddr 08:00:27:e9:fa:c9
>>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>           RX packets:254 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:26367 (26.3 KB)  TX bytes:0 (0.0 B)
>>>
>>> eth3      Link encap:Ethernet  HWaddr 08:00:27:b9:97:65
>>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>           RX packets:49 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:1000
>>>           RX bytes:15174 (15.1 KB)  TX bytes:0 (0.0 B)
>>>
>>> lo        Link encap:Local Loopback
>>>           inet addr:127.0.0.1  Mask:255.0.0.0
>>>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>>>           RX packets:3346 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:3346 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:0
>>>           RX bytes:266036 (266.0 KB)  TX bytes:266036 (266.0 KB)
>>>
>>> ovs-system Link encap:Ethernet  HWaddr 52:ad:7b:47:e3:97
>>>           BROADCAST MULTICAST  MTU:1500  Metric:1
>>>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>>>           collisions:0 txqueuelen:0
>>>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
>>>
>>>
>>> On Sat, May 2, 2015 at 5:27 AM, Manik Sidana <maniksidana019 at gmail.com>
>>> wrote:
>>>
>>>> Hi Aj Nouri,
>>>>
>>>> Can you also share the output of below commands
>>>> ovs-ofctl dump-flows br0
>>>> ovs-ofctl show br0
>>>> ovs-vsctl show
>>>> ifconfig -a
>>>>
>>>>
>>>>
>>>> -------- Original message --------
>>>> From: AJ NOURI <ajn.bin at gmail.com>
>>>> Date: 02/05/2015 02:31 (GMT+05:30)
>>>> To: discuss at openvswitch.org
>>>> Subject: [ovs-discuss] Mirroring works only for layer2 traffic.
>>>>
>>>>
>>>> Hi everyone,
>>>>
>>>> For testing purposes, I am using Open vswitch to mirror traffic from 2
>>>> interfaces eth1 and eth2 to eth3. I am using the following command:
>>>>
>>>> ovs-vsctl -- set Bridge br0 mirrors=@m \
>>>>  -- --id=@eth1 get Port eth1 \
>>>>  -- --id=@eth2 get Port eth2 \
>>>>  -- --id=@eth3 get Port eth3 \
>>>>  -- --id=@m create Mirror name=e1e2toe3 select-dst-port=@eth1
>>>> select-src-port=@eth1 output-port=@eth3
>>>>
>>>> A node with tcpdump is connected to eth3.
>>>>
>>>> tcpdump shows only layer2 traffic: ARP, CDP (Cisco devices connected to
>>>> eth1 and eth2) conversations between devices connected to eth1 and eth2,
>>>> but no upper layers:
>>>> ex: pings, ssh, telnet not visible.
>>>>
>>>> Any hint?
>>>>
>>>> AJ NOURI
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20150508/1f8fed65/attachment-0002.html>


More information about the discuss mailing list