Akshya11235
Akshya11235

Reputation: 1029

How can I forward traffic from a specific port to another in open-vswitch

I am trying to setup an ovs as a transit switch. This would be used to create a data network for a docker container.

i.e. In the diagram below, I was able to add veth0-veth3 and veth100 to veth103 to the ovs. but I want to configure such that all traffic from veth0 goes to veth100 and vice versa. Similarly veth1-veth101, veth2-veth102, veth3-veth103 pairs. One way it could be done was to use vlans, but if possible I wanted to avoid doing that. Is there a configuration possible that allows the pinning of ports as described above?

                Openvswitch              
              +-------------+              
veth0  +------+             +--veth100--
veth1  +------+             +--veth101--
veth2  +------+             +--veth102--
veth3  +------+             +--veth103-- 
              +-------------+

Upvotes: 2

Views: 1350

Answers (1)

Akshya11235
Akshya11235

Reputation: 1029

This could be done by the following command:

ovs-ofctl add-flow <Bridge> in_port=<src_Port>,actions=<Action>

In the <Action> put the destination port as follows:

output:destination_port

Upvotes: 2

Related Questions