-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add detailed info about vlan capabilities on bridge #134
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,22 +47,6 @@ If the bridge is missing, the plugin will create one on first use and, if gatewa | |
} | ||
``` | ||
|
||
## Example L2-only vlan configuration | ||
```json | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "mynet", | ||
"type": "bridge", | ||
"bridge": "mynet0", | ||
"vlan": 100, | ||
"vlanTrunk": [ | ||
{ "id": 101 }, | ||
{ "minID": 200, "maxID": 299 } | ||
], | ||
"ipam": {} | ||
} | ||
``` | ||
|
||
## Example L2-only, disabled interface configuration | ||
```json | ||
{ | ||
|
@@ -94,9 +78,44 @@ If the bridge is missing, the plugin will create one on first use and, if gatewa | |
* `macspoofchk` (boolean, optional): Enables mac spoof check, limiting the traffic originating from the container to the mac address of the interface. Defaults to false. | ||
* `disableContainerInterface` (boolean, optional): Set the container interface (veth peer inside the container netns) state down. When enabled, IPAM cannot be used. | ||
|
||
*Note:* The VLAN parameter configures the VLAN tag on the host end of the veth and also enables the vlan_filtering feature on the bridge interface. | ||
## VLAN capabilities | ||
|
||
The `vlan` and `vlanTrunk` parameters are mutually exclusive. | ||
|
||
The `vlan` parameter configures the VLAN tag on the host end of the veth and also enables the vlan_filtering feature on the bridge interface. The VLAN_DEFAULT_PVID of the bridge (when set), is added by default on the port as a VID untagged on egress. This is in most cases not desirable. Use the `preserveDefaultVlan` parameter to remove it. | ||
|
||
The `vlanTrunk` parameter allows to add a single VID or a range of VIDs (see example below). The native vlan of the trunk is the VLAN_DEFAULT_PVID of the bridge. This VID is added by default on the port with PVID and UNTAGGED options enabled. There are two known limitations due to this. First, all trunk ports on the bridge have the same native vlan. Second, the default PVID of the bridge is currently not configurable. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to try and explain things from the bridge perspective. It would help if the explanation is limited to the CNI plugin configuration which abstract the bridge side details. |
||
|
||
To configure uplink for L2 network you need to allow the vlan on the uplink interface by using the following command ``` bridge vlan add vid VLAN_ID dev DEV```. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure what this is suppose to do exactly. I am guessing this relates to defining a trunk port from the bridge to the node interface. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that was there before. We could review this in another pr |
||
|
||
|
||
### Example L2-only vlan configuration | ||
```json | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "mynet", | ||
"type": "bridge", | ||
"bridge": "mynet0", | ||
"vlan": 100, | ||
"preserveDefaultVlan": false, | ||
"ipam": {} | ||
} | ||
``` | ||
|
||
### Example L2-only vlan trunk configuration | ||
```json | ||
{ | ||
"cniVersion": "0.3.1", | ||
"name": "mynet", | ||
"type": "bridge", | ||
"bridge": "mynet0", | ||
"vlanTrunk": [ | ||
{ "id": 101 }, | ||
{ "minID": 200, "maxID": 299 }], | ||
"ipam": {} | ||
} | ||
``` | ||
Comment on lines
+92
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: It is just 'good to have' comment, so you can ignore that How about to use latest CNI spec, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be good, indeed. However, most (if not all) of the configuration examples use version "0.3.1". So, let's create a separate PR where we update the version in the examples of all plugins. |
||
|
||
*Note:* To configure uplink for L2 network you need to allow the vlan on the uplink interface by using the following command ``` bridge vlan add vid VLAN_ID dev DEV```. | ||
|
||
## Interface configuration arguments reference | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to try and explain this with
VLAN_DEFAULT_PVID
as a side-note, just because it is not assured that a reader will understand what it means.E.g. it is not clear who sets it in the first place.
But, as commented in the next comment, I would suggest to avoid adding bridge details here, just explain the configuration abstracted in this plugin and its outcomes.
Also, could you please clarify what "default"
preserveDefaultVlan
refers to?And what is its default value (when it does not appear in the config)?
Maybe it is worth trying to explain what are the side effects of having this set or not.