rhel: Enable DHCP support for internal ports.
[sliver-openvswitch.git] / rhel / README.RHEL
1 Red Hat network scripts integration
2 -----------------------------------
3
4 The RPM packages for Open vSwitch provide some integration with Red
5 Hat's network scripts.  Using this integration is optional.
6
7 To use the integration for a Open vSwitch bridge or interface named
8 <name>, create or edit /etc/sysconfig/network-scripts/ifcfg-<name>.
9 This is a shell script that consists of a series of VARIABLE=VALUE
10 assignments.  The following OVS-specific variable names are supported:
11
12     - DEVICETYPE: Always set to "ovs".
13
14     - TYPE: If this is "OVSBridge", then this file represents an OVS
15       bridge named <name>.  Otherwise, it represents a port on an OVS
16       bridge and TYPE must have one of the following values:
17
18         * "OVSPort", if <name> is a physical port (e.g. eth0) or
19           virtual port (e.g. vif1.0).
20
21         * "OVSIntPort", if <name> is an internal port (e.g. a tagged
22           VLAN).
23
24         * "OVSBond", if <name> is an OVS bond.
25
26         * "OVSTunnel", if <name> is an OVS tunnel.
27
28     - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to
29       the name of the OVS bridge to which the port should be attached.
30
31     - OVS_OPTIONS: Optionally, extra options to set in the "Port"
32       table when adding the port to the bridge, as a sequence of
33       column[:key]=value options.  For example, "tag=100" to make the
34       port an access port for VLAN 100.  See the documentation of
35       "add-port" in ovs-vsctl(8) for syntax and the section on the
36       Port table in ovs-vswitchd.conf.db(5) for available options.
37
38     - OVS_EXTRA: Optionally, additional ovs-vsctl commands, separated
39       by "--" (double dash).
40
41     - BOND_IFACES: For "OVSBond" interfaces, a list of physical
42       interfaces to bond together.
43
44     - OVS_TUNNEL_TYPE: For "OVSTunnel" interfaces, the type of the tunnel.
45       For example, "gre", "vxlan", etc.
46
47     - OVS_TUNNEL_OPTIONS: For "OVSTunnel" interfaces, this field should be
48       used to specify the tunnel options like remote_ip, key, etc.
49
50 Note
51 ----
52
53 * "ifdown" on a bridge will not bring individual ports on the bridge
54 down.  "ifup" on a bridge will not add ports to the bridge.  This
55 behavior should be compatible with standard bridges (with
56 TYPE=Bridge).
57
58 * If 'ifup' on an interface is called multiple times, one can see
59 "RTNETLINK answers: File exists" printed on the console. This comes from
60 ifup-eth trying to add zeroconf route multiple times and is harmless.
61
62 Examples
63 --------
64
65 Standalone bridge:
66
67 ==> ifcfg-ovsbridge0 <==
68 DEVICE=ovsbridge0
69 ONBOOT=yes
70 DEVICETYPE=ovs
71 TYPE=OVSBridge
72 BOOTPROTO=static
73 IPADDR=A.B.C.D
74 NETMASK=X.Y.Z.0
75 HOTPLUG=no
76
77 Enable DHCP on the bridge:
78 * Needs OVSBOOTPROTO instead of BOOTPROTO.
79 * All the interfaces that can reach the DHCP server
80 as a space separated list in OVSDHCPINTERFACES.
81
82 DEVICE=ovsbridge0
83 ONBOOT=yes
84 DEVICETYPE=ovs
85 TYPE=OVSBridge
86 OVSBOOTPROTO="dhcp"
87 OVSDHCPINTERFACES="eth0"
88 HOTPLUG=no
89
90
91 Adding Internal Port to ovsbridge0:
92
93 ==> ifcfg-intbr0 <==
94 DEVICE=intbr0
95 ONBOOT=yes
96 DEVICETYPE=ovs
97 TYPE=OVSIntPort
98 OVS_BRIDGE=ovsbridge0
99 HOTPLUG=no
100
101
102 Internal Port with fixed IP address:
103
104 DEVICE=intbr0
105 ONBOOT=yes
106 DEVICETYPE=ovs
107 TYPE=OVSIntPort
108 OVS_BRIDGE=ovsbridge0
109 BOOTPROTO=static
110 IPADDR=A.B.C.D
111 NETMASK=X.Y.Z.0
112 HOTPLUG=no
113
114 Internal Port with DHCP:
115 * Needs OVSBOOTPROTO or BOOTPROTO.
116 * All the interfaces that can reach the DHCP server
117 as a space separated list in OVSDHCPINTERFACES.
118
119 DEVICE=intbr0
120 ONBOOT=yes
121 DEVICETYPE=ovs
122 TYPE=OVSIntPort
123 OVS_BRIDGE=ovsbridge0
124 OVSBOOTPROTO="dhcp"
125 OVSDHCPINTERFACES="eth0"
126 HOTPLUG=no
127
128 Adding physical eth0 to ovsbridge0 described above:
129
130 ==> ifcfg-eth0 <==
131 DEVICE=eth0
132 ONBOOT=yes
133 DEVICETYPE=ovs
134 TYPE=OVSPort
135 OVS_BRIDGE=ovsbridge0
136 BOOTPROTO=none
137 HOTPLUG=no
138
139
140 Tagged VLAN interface on top of ovsbridge0:
141
142 ==> ifcfg-vlan100 <==
143 DEVICE=vlan100
144 ONBOOT=yes
145 DEVICETYPE=ovs
146 TYPE=OVSIntPort
147 BOOTPROTO=static
148 IPADDR=A.B.C.D
149 NETMASK=X.Y.Z.0
150 OVS_BRIDGE=ovsbridge0
151 OVS_OPTIONS="tag=100"
152 OVS_EXTRA="set Interface $DEVICE external-ids:iface-id=$(hostname -s)-$DEVICE-vif"
153 HOTPLUG=no
154
155
156 Bonding:
157
158 ==> ifcfg-bond0 <==
159 DEVICE=bond0
160 ONBOOT=yes
161 DEVICETYPE=ovs
162 TYPE=OVSBond
163 OVS_BRIDGE=ovsbridge0
164 BOOTPROTO=none
165 BOND_IFACES="gige-1b-0 gige-1b-1 gige-21-0 gige-21-1"
166 OVS_OPTIONS="bond_mode=balance-tcp lacp=active"
167 HOTPLUG=no
168
169 ==> ifcfg-gige-* <==
170 DEVICE=gige-*
171 ONBOOT=yes
172 HOTPLUG=no
173
174 An Open vSwitch Tunnel:
175
176 ==> ifcfg-gre0 <==
177 DEVICE=ovs-gre0
178 ONBOOT=yes
179 DEVICETYPE=ovs
180 TYPE=OVSTunnel
181 OVS_BRIDGE=ovsbridge0
182 OVS_TUNNEL_TYPE=gre
183 OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D"
184
185 Reporting Bugs
186 --------------
187
188 Please report problems to bugs@openvswitch.org.