containernetworking / plugins

Some reference and example networking plugins, maintained by the CNI team.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how does `bridge` work with `vlanTrunk` ?

nathanaelle opened this issue · comments

hi,

I think I don't understand how to use vlanTrunk :

my conflist is :

{
        "cniVersion": "1.0.0",
        "name": "LocalBridgeOnVlan42",
        "plugins": [
                {
                        "type":"bridge",
                        "bridge":"LocalBridge",
                        "vlanTrunk": [{ "id": 42 }],
                        "ipam":{
                                "type":"static",
                                "addresses": [{
                                        "address":"10.3.2.1/32"
                                }]
                        }
                }
        ]
}

normaly I expect to have in bridge -j -p vlan reply :

[{
        "ifname": "vethRandomName",
        "vlans": [ {
                "vlan": 42
            } ]
} ]

I don't have this result.

but if I divert brigde on a shell script where I add :

ifName=$(echo "${bridge_stdout}" | jq -r '.interfaces[1].name')
vlanTrunk=$(echo "${bridge_stdin}" | jq -r '.vlanTrunk | map(.id) | join(" ")')

for vlan in "${vlanTrunk}"
do
	bridge vlan add dev "${ifName}" vid "${vlan}"
done

then I get the expected result for bridge -j -p vlan

So, I think there is something I don't understand on how to use vlan with bridge.

sorry.