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

bridge: add vlan trunk support #829

Merged
merged 1 commit into from
Apr 24, 2023

Commits on Apr 19, 2023

  1. bridge: add vlan trunk support

    add vlan trunk support for veth
    vlan trunk only support L2 only mode without any IPAM
    refer ovs-cni design
    https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/pkg/plugin/plugin.go
    
    design:
    origin "vlan" option will be PVID or untagged vlan for the network.
    "vlanTrunk" will setup tagged vlan for veth.
    
    entry type:
    `{ "id": 100 }` will specify only tagged vlan 100
    `{ "minID": 100, "maxID": 120 }` will specify tagged vlan from 100 to
    120 (include 100 and 120)
    vlanTrunk is a list of above entry type, so you can use this to add
    tagged vlan
    `[
      { "id": 100 },
      {
        "minID": 1000,
        "maxID": 2000
      }
    ]`
    
    complete config will be like this
    {
      "cniVersion": "0.3.1",
      "name": "mynet",
      "type": "bridge",
      "bridge": "mynet0",
      "vlan": 100,
      "vlanTrunk": [
        { "id": 101 },
        { "minID": 1000, "maxID": 2000 },
        { "minID": 3000, "maxID": 4000 }
      ],
      "ipam": {}
    }
    
    Signed-off-by: Date Huang <date.huang@suse.com>
    Date Huang authored and tjjh89017 committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    090af7d View commit details
    Browse the repository at this point in the history