Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovs: ability to set VLAN tag on port #56

Open
hwchiu opened this issue Jun 6, 2018 · 6 comments
Open

ovs: ability to set VLAN tag on port #56

hwchiu opened this issue Jun 6, 2018 · 6 comments

Comments

@hwchiu
Copy link
Contributor

hwchiu commented Jun 6, 2018

Hi.
I want to use the vSwitch client to add the port with the vlan tag.

I saw the original AddPort method only accept the interface name but no more options.

func (v *VSwitchService) AddPort(bridge string, port string) error {
_, err := v.exec("--may-exist", "add-port", bridge, string(port))
return err
}

Thanks.

@mdlayher
Copy link
Contributor

mdlayher commented Jun 6, 2018

I wasn't even aware of this option until now. To clarify, can you not accomplish the same thing by pushing/popping VLANs with flows?

@hwchiu
Copy link
Contributor Author

hwchiu commented Jun 6, 2018

In some scenario, we use the normal action to do the simple L2 forwarding and we will use the trunk for some ports and tag for some ports.
It's not convenient to use the flow to push/pop vlang when we use the normal action to forward packets.

@mdlayher
Copy link
Contributor

mdlayher commented Jun 6, 2018

I think I would prefer to add this alongside the other "ovs-vsctl set" methods in this structure: https://github.com/digitalocean/go-openvswitch/blob/master/ovs/vswitch.go#L182 for consistency, rather than adding more parameters to AddPort immediately. PRs are welcome.

@mdlayher mdlayher changed the title How to add the port with the vlanTag ovs: ability to set VLAN tag on port Jun 6, 2018
@chenyunchen
Copy link
Contributor

Please have a look. #57

@steveyiyo
Copy link

Hello everyone in this thread,

I'm currently attempting to add a new network interface card to a bridge and apply a VLAN tag to it, similar to separating it directly from the Ethernet interface, as shown below:

sudo ovs-vsctl add-port ovs-br0 vlan1383 tag=1383 -- set Interface vlan1383 type=internal

I've noticed that the AddPort function doesn't support additional parameters, and I referred to the following sources for guidance: #56 (comment) and #57 PR (by @chenyunchen).

However, according to the official documentation, ovs-vsctl add-port does support additional features such as GRE, DPDK, erspan, etc.
ref: https://docs.openvswitch.org/en/latest/faq/configuration/

I'm interested in finding out if @mdlayher is willing to add more parameters to the AddPort function or if I could help implement these additional features, as it appears that they cannot be implemented through ovs-vsctl.

On a side note, my Open vSwitch version is as follows:

steveyiyo@cr1-tpe:~$ sudo ovs-vsctl -V
ovs-vsctl (Open vSwitch) 3.1.0
DB Schema 8.3.1

Thank you, and please feel free to share any additional ideas or thoughts.

@mdlayher
Copy link
Contributor

mdlayher commented May 6, 2023

I haven't worked for DigitalOcean in several years now. Best of luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants