1
1
// Module included in the following assemblies:
2
2
//
3
+ // * networking/multiple-networks/configuring-bridge.adoc
3
4
4
5
[id="nw-multus-bridge-object_{context}"]
5
6
= Configuration for bridge
6
7
7
- // TODO - duplicated in ipvlan, copy changes from there to here.
8
+ The configuration for an additional network attachment that uses the bridge
9
+ Container Network Interface (CNI) plug-in is provided in two parts:
8
10
9
- .bridge CNI plug-in YAML configuration
11
+ * Cluster Network Operator (CNO) configuration
12
+ * CNI plug-in configuration
13
+
14
+ The CNO configuration specifies the name for the additional network attachment
15
+ and the namespace to create the attachment in. The plug-in
16
+ is configured by a JSON object specified by the `rawCNIConfig` parameter in
17
+ the CNO configuration.
18
+
19
+ The following YAML describes the configuration parameters for the CNO:
20
+
21
+ .Cluster Network Operator YAML configuration
10
22
[source,yaml]
11
23
----
12
24
name: <name> <1>
13
25
namespace: <namespace> <2>
14
- rawCNIConfig: '' <3>
26
+ rawCNIConfig: '{ <3>
27
+ ...
28
+ }'
15
29
type: Raw
16
30
----
17
- <1> `name`: Specify the name of the `NetworkAttachmentDefinition` created from
18
- the `rawCNIConfig` JSON object.
31
+ <1> Specify a name for the additional network attachment that you are
32
+ creating. The name must be unique within the specified `namespace`.
33
+
34
+ <2> Specify the namespace to create the network attachment in. If
35
+ you do not specify a value, then the `default` namespace is used.
19
36
20
- <2> `namespace`: Specify the namespace to create the network attachment in. If
21
- a value is not specified, the `default` namespace is used .
37
+ <3> Specify the CNI plug-in configuration in JSON format, which
38
+ is based on the following template .
22
39
23
- <3> `rawCNIConfig`: Specify the CNI plug-in configuration.
40
+ The following object describes the configuration parameters for the bridge CNI
41
+ plug-in:
24
42
25
43
.bridge CNI plug-in JSON configuration object
26
44
[source,json]
@@ -43,42 +61,65 @@ a value is not specified, the `default` namespace is used.
43
61
"mtu": <mtu> <11>
44
62
}
45
63
----
46
- <1> `name`: Specify the name of the `NetworkAttachmentDefinition`.
64
+ <1> Specify the value for the `name` parameter you provided previously for
65
+ the CNO configuration.
47
66
48
- <2> `bridge`: Specify the name of the virtual bridge to use. If the bridge
67
+ <2> Specify the name of the virtual bridge to use. If the bridge
49
68
interface does not exist on the host, it is created. The default value is
50
69
`cni0`.
51
70
52
- <3> `ipam`: Specify a configuration object for the ipam CNI plug-in. The plug-in
71
+ <3> Specify a configuration object for the ipam CNI plug-in. The plug-in
53
72
manages IP address assignment for the network attachment definition.
54
73
55
- <4> `ipMasq`: Set to `true` to enable IP masquerading for traffic that leaves the
74
+ <4> Set to `true` to enable IP masquerading for traffic that leaves the
56
75
virtual network. The source IP address for all traffic is rewritten to the
57
76
bridge's IP address. If the bridge does not have an IP address, this setting has
58
77
no effect. The default value is `false`.
59
78
60
- <5> `isGateway`: Set to `true` to assign an IP address to the bridge. The
79
+ <5> Set to `true` to assign an IP address to the bridge. The
61
80
default value is `false`.
62
81
63
- <6> `isDefaultGateway`: Set to `true` to configure the bridge as the default
82
+ <6> Set to `true` to configure the bridge as the default
64
83
gateway for the virtual network. The default value is `false`. If
65
84
`isDefaultGateway` is set to `true`, then `isGateway` is also set to `true`
66
85
automatically.
67
86
68
- <7> `forceAddress`: Set to `true` to allow assignment of a previously assigned
87
+ <7> Set to `true` to allow assignment of a previously assigned
69
88
IP address to the virtual bridge. When set to `false`, if an IPv4 address or an
70
89
IPv6 address from overlapping subsets is assigned to the virtual bridge, an
71
90
error occurs. The default value is `false`.
72
91
73
- <8> `hairpinMode`: Set to `true` to allow the virtual bridge to send an ethernet
92
+ <8> Set to `true` to allow the virtual bridge to send an ethernet
74
93
frame back through the virtual port it was received on. This mode is also known
75
94
as _reflective relay_. The default value is `false`.
76
95
77
- <9> `promiscMode`: Set to `true` to enable promiscuous mode on the bridge. The
96
+ <9> Set to `true` to enable promiscuous mode on the bridge. The
78
97
default value is `false`.
79
98
80
- <10> `vlan`: Specify a virtual LAN (VLAN) tag as an integer value. By default,
99
+ <10> Specify a virtual LAN (VLAN) tag as an integer value. By default,
81
100
no VLAN tag is assigned.
82
101
83
- <11> `mtu`: Set the maximum transmission unit (MTU) to the specified value. The
84
- default value is automatically chosen by the kernel.
102
+ <11> Set the maximum transmission unit (MTU) to the specified value. The
103
+ default value is automatically set by the kernel.
104
+
105
+ [id="nw-multus-bridge-config-example_{context}"]
106
+ == bridge configuration example
107
+
108
+ The following example configures an additional network named `bridge-net`:
109
+
110
+ [source,yaml]
111
+ ----
112
+ name: bridge-net
113
+ type: Raw
114
+ rawCNIConfig: '{ <1>
115
+ "cniVersion": "0.3.1",
116
+ "type": "bridge",
117
+ "master": "eth1",
118
+ "isGateway": true,
119
+ "vlan": 2,
120
+ "ipam": {
121
+ "type": "dhcp"
122
+ }
123
+ }'
124
+ ----
125
+ <1> The CNI configuration object is specified as a YAML string.
0 commit comments