]> git.proxmox.com Git - ovs.git/blame - debian/openvswitch-switch.README.Debian
initial import
[ovs.git] / debian / openvswitch-switch.README.Debian
CommitLineData
9a25910a
TL
1Debian network scripts integration
2----------------------------------
3This package lets a user to optionally configure Open vSwitch bridges
4and ports from /etc/network/interfaces. Please refer to the interfaces(5)
5manpage for more details regarding /etc/network/interfaces.
6
7The stanzas that configure the OVS bridges should begin with "allow-ovs"
8followed by name of the bridge. Here is an example.
9allow-ovs br0
10
11The stanzas that configure the OVS ports should begin with
12"allow-${bridge-name}" followed by name of the port. Here is an example.
13allow-br0 eth0
14
15The following OVS specific "command" options are supported:
16
17 - ovs_type: This can either be OVSBridge, OVSPort, OVSIntPort, OVSBond,
18 OVSPatchPort or OVSTunnel depending on whether you configure a bridge,
19 port, an internal port, a bond, a patch port or a tunnel. This is a
20 required option.
21
22 - ovs_ports: This option specifies all the ports that belong to a bridge.
23
24 - ovs_bridge: This options specifies a bridge to which a port belongs.
25 This is a required option for a port.
26
27 - ovs_bonds: This option specifies the list of physical interfaces to be
28 bonded together.
29
30 - ovs_patch_peer: For "OVSPatchPort" interfaces, this field specifies
31 the patch's peer on the other bridge.
32
33 - ovs_tunnel_type: For "OVSTunnel" interfaces, the type of the tunnel.
34 For example, "gre", "vxlan", etc.
35
36 - ovs_tunnel_options: For "OVSTunnel" interfaces, this field should be
37 used to specify the tunnel options like remote_ip, key, etc.
38
39 - ovs_options: This option lets you add extra arguments to a ovs-vsctl
40 command. See examples.
41
42 - ovs_extra: This option lets you run additional ovs-vsctl commands,
43 separated by "--" (double dash). Variables can be part of the "ovs_extra"
44 option. You can provide all the standard environmental variables
45 described in the interfaces(5) man page. You can also pass shell
46 commands.
47
48More implementation specific details can be seen in the examples.
49
50Examples:
51--------
52ex 1: A standalone bridge.
53
54allow-ovs br0
55iface br0 inet static
56 address 192.168.1.1
57 netmask 255.255.255.0
58 ovs_type OVSBridge
59
60ex 2: A bridge with one port.
61
62allow-ovs br0
63iface br0 inet dhcp
64 ovs_type OVSBridge
65 ovs_ports eth0
66
67allow-br0 eth0
68iface eth0 inet manual
69 ovs_bridge br0
70 ovs_type OVSPort
71
72ex 3: A bridge with multiple physical ports.
73
74allow-ovs br0
75iface br0 inet dhcp
76 ovs_type OVSBridge
77 ovs_ports eth0 eth1
78
79allow-br0 eth0
80iface eth0 inet manual
81 ovs_bridge br0
82 ovs_type OVSPort
83
84allow-br0 eth1
85iface eth1 inet manual
86 ovs_bridge br0
87 ovs_type OVSPort
88
89ex 4: A bridge with an OVS internal port.
90
91allow-ovs br1
92iface br1 inet static
93 address 192.168.1.1
94 netmask 255.255.255.0
95 ovs_type OVSBridge
96 ovs_ports vlan100
97
98allow-br1 vlan100
99iface vlan100 inet manual
100 ovs_bridge br1
101 ovs_type OVSIntPort
102 ovs_options tag=100
103 ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)
104
105ex 5: Bonding.
106
107allow-ovs br2
108iface br2 inet static
109 address 192.170.1.1
110 netmask 255.255.255.0
111 ovs_type OVSBridge
112 ovs_ports bond0
113
114allow-br2 bond0
115iface bond0 inet manual
116 ovs_bridge br2
117 ovs_type OVSBond
118 ovs_bonds eth2 eth3
119 ovs_options bond_mode=balance-tcp lacp=active
120
121ex 6: Patch ports.
122
123allow-ovs br0
124iface br0 inet manual
125 ovs_type OVSBridge
126 ovs_ports patch0
127
128allow-br0 patch0
129iface patch0 inet manual
130 ovs_bridge br0
131 ovs_type OVSPatchPort
132 ovs_patch_peer patch1
133
134allow-ovs br1
135iface br1 inet manual
136 ovs_type OVSBridge
137 ovs_ports patch1
138
139allow-br1 patch1
140iface patch1 inet manual
141 ovs_bridge br1
142 ovs_type OVSPatchPort
143 ovs_patch_peer patch0
144
145ex 7: Tunnel.
146
147allow-ovs br1
148iface br1 inet static
149 address 192.168.1.1
150 netmask 255.255.255.0
151 ovs_type OVSBridge
152 ovs_ports gre1
153
154allow-br1 gre1
155iface gre1 inet manual
156 ovs_bridge br1
157 ovs_type OVSTunnel
158 ovs_tunnel_type gre
159 ovs_tunnel_options options:remote_ip=182.168.1.2 options:key=1
160
161ex 8: Create and destroy bridges.
162
163ifup --allow=ovs $list_of_bridges
164ifdown --allow=ovs $list_of_bridges
165
166ex 9: Bond + Bridge + VLAN + MTU
167
168allow-bond0 eth2
169iface eth2 inet manual
170 ovs_type OVSPort
171 ovs_bonds bond0
172 ovs_mtu 9000
173
174# Interface eth3
175#auto eth3
176allow-bond0 eth3
177iface eth3 inet manual
178 ovs_type OVSPort
179 ovs_bonds bond0
180 ovs_mtu 9000
181
182# Interface bond0
183auto bond0
184allow-br-ex bond0
185iface bond0 inet manual
186 ovs_bridge br-ex
187 ovs_type OVSBond
188 ovs_bonds eth2 eth3
189 ovs_options bond_mode=balance-tcp lacp=active other_config:lacp-time=fast
190 ovs_mtu 9000
191 up ifup eth2
192 up ifup eth3
193 up ovs-vsctl set Interface ${IFACE} mtu_request=${IF_OVS_MTU}
194
195# Interface vlan81
196auto vlan871
197allow-br-ex vlan81
198iface vlan81 inet static
199 ovs_type OVSIntPort
200 ovs_bridge br-ex
201 ovs_options tag=81
202 ovs_extra set interface ${IFACE} external-ids:iface-id=$(hostname -s)-${IFACE}-vif
203 ovs_mtu 9000
204 address 192.168.100.2
205 network 192.168.100.0
206 netmask 255.255.255.0
207 broadcast 192.168.100.255
208 gateway 192.168.100.1
209
210# Interface br-ex
211auto br-ex
212allow-ovs br-ex
213iface br-ex inet manual
214 ovs_type OVSBridge
215 ovs_ports bond0 vlan81
216 ovs_mtu 9000
217
218
219Notes on dependencies:
220---------------------
221
222openvswitch-switch depends on $network, $named $remote_fs and $syslog to start.
223This creates some startup dependency issues.
224
225* Since openvswitch utilities are placed in /usr and /usr can be mounted
226through NFS, openvswitch has to start after it. But if a user uses openvswitch
227for all his networking needs and hence to mount NFS, there will be a deadlock.
228So, if /usr is mounted through NFS and openvswitch is used for all networking,
229the administrator should figure out a way to mount NFS before starting OVS.
230One way to do this is in initramfs.
231
232* Since openvswitch starts after $network, $remote_fs and $syslog, any startup
233script that depends on openvswitch but starts before it, needs to be changed
234to depend on openvswitch-switch too.
235
236* Ideally, an admin should not add openvswitch bridges in the 'auto'
237section of the 'interfaces' file. This is because, when ifupdown starts
238working on bridges listed in 'auto', openvswitch has not yet started.
239
240But, if the admin wants to go down this route and adds openvswitch bridges
241in the 'auto' section, openvswitch-switch will forcefully be started when
242ifupdown kicks in. In a case like this, the admin needs to make sure that /usr
243has already been mounted and that a remote $syslog (if used) is ready to
244receive openvswitch logs.
245
246 -- Ben Pfaff <pfaffben@debian.org>, Fri, 23 Dec 2016 09:45:56 -0800