diff options
author | Gurucharan Shetty <gshetty@nicira.com> | 2012-01-30 20:17:53 -0800 |
---|---|---|
committer | Gurucharan Shetty <gshetty@nicira.com> | 2012-01-31 14:25:39 -0800 |
commit | 5442edb9e0afb6fdc4cd81e5d1ebd3e0d4e6accf (patch) | |
tree | db31eadbcb945041e3326725525d159a505b984c /rhel/etc_sysconfig_network-scripts_ifup-ovs | |
parent | fe13b0e71752a5eb30b21e7a09d2f9370bc02387 (diff) |
rhel: Enable DHCP in redhat network scripts.
The current network-script, ifup-ovs does not work well if you
enable DHCP on the OVS. It will work if we name the bridge
alphabetically greater than the underlying physical interfaces.
Even then, it will do multiple DHCP attempts slowing down the boot
up process.
This patch allows DHCP on an OVS bridge.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Diffstat (limited to 'rhel/etc_sysconfig_network-scripts_ifup-ovs')
-rwxr-xr-x | rhel/etc_sysconfig_network-scripts_ifup-ovs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs index 7074c072..18cebc4d 100755 --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs @@ -36,12 +36,25 @@ fi case "$TYPE" in OVSBridge) ovs-vsctl -- --may-exist add-br "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} - ${OTHERSCRIPT} ${CONFIG} ${2} + if [ "${OVSBOOTPROTO}" = "dhcp" ] && [ -n "${OVSINTF}" ]; then + case ${OVSDHCPINTERFACES} in + ${OVSINTF#ifcfg-} | \ + "${OVSINTF#ifcfg-},"* | \ + *",${OVSINTF#ifcfg-}" | \ + *",${OVSINTF#ifcfg-},"*) + BOOTPROTO=dhcp ${OTHERSCRIPT} ${CONFIG} + ;; + esac + fi + if [ "${OVSBOOTPROTO}" != "dhcp" ] && [ -z "${OVSINTF}" ]; then + ${OTHERSCRIPT} ${CONFIG} + fi ;; OVSPort) /sbin/ifup "$OVS_BRIDGE" ${OTHERSCRIPT} ${CONFIG} ${2} ovs-vsctl -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} + OVSINTF=${CONFIG} /sbin/ifup "$OVS_BRIDGE" ;; OVSIntPort) /sbin/ifup "$OVS_BRIDGE" @@ -55,6 +68,7 @@ case "$TYPE" in done ovs-vsctl -- --fake-iface add-bond "$OVS_BRIDGE" "$DEVICE" ${BOND_IFACES} $OVS_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} ${OTHERSCRIPT} ${CONFIG} ${2} + OVSINTF=${CONFIG} /sbin/ifup "$OVS_BRIDGE" ;; *) echo $"Invalid OVS interface type $TYPE" |