The current initscripts ifup-ovs brings up internal ports as
an ordinary ethernet device, so BOOTPROTO=dhcp|none does not
consider any OVS/bridge detail.
Since DHCP requires a port in the bridge to reach the server,
bring up the required port before in the same way it does for
OVS bridge.
Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
OVSDHCPINTERFACES="eth0"
HOTPLUG=no
+
+Adding Internal Port to ovsbridge0:
+
+==> ifcfg-intbr0 <==
+DEVICE=intbr0
+ONBOOT=yes
+DEVICETYPE=ovs
+TYPE=OVSIntPort
+OVS_BRIDGE=ovsbridge0
+HOTPLUG=no
+
+
+Internal Port with fixed IP address:
+
+DEVICE=intbr0
+ONBOOT=yes
+DEVICETYPE=ovs
+TYPE=OVSIntPort
+OVS_BRIDGE=ovsbridge0
+BOOTPROTO=static
+IPADDR=A.B.C.D
+NETMASK=X.Y.Z.0
+HOTPLUG=no
+
+Internal Port with DHCP:
+* Needs OVSBOOTPROTO or BOOTPROTO.
+* All the interfaces that can reach the DHCP server
+as a space separated list in OVSDHCPINTERFACES.
+
+DEVICE=intbr0
+ONBOOT=yes
+DEVICETYPE=ovs
+TYPE=OVSIntPort
+OVS_BRIDGE=ovsbridge0
+OVSBOOTPROTO="dhcp"
+OVSDHCPINTERFACES="eth0"
+HOTPLUG=no
+
Adding physical eth0 to ovsbridge0 described above:
==> ifcfg-eth0 <==
OVSIntPort)
ifup_ovs_bridge
ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=internal ${OVS_EXTRA+-- $OVS_EXTRA}
- ${OTHERSCRIPT} ${CONFIG} ${2}
+ if [ -n "${OVSDHCPINTERFACES}" ]; then
+ for _iface in ${OVSDHCPINTERFACES}; do
+ /sbin/ifup ${_iface}
+ done
+ fi
+ BOOTPROTO="${OVSBOOTPROTO}" ${OTHERSCRIPT} ${CONFIG} ${2}
;;
OVSBond)
ifup_ovs_bridge