[ovs-dev] [PATCH] rhel: Enable DHCP support for internal ports

Gurucharan Shetty shettyg at nicira.com
Mon Jan 13 21:06:53 UTC 2014


On Mon, Jan 13, 2014 at 12:53 PM, Flavio Leitner <fbl at redhat.com> wrote:
> 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.
I am a little confused here. Why specify BOOTPROTO for a internal
port? Shouldn't it be specified on the bridge?

According to the README file:

Enable DHCP on the bridge:
* Needs OVSBOOTPROTO instead of BOOTPROTO.
* All the interfaces that can reach the DHCP server
as a space separated list in OVSDHCPINTERFACES.

DEVICE=ovsbridge0
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
OVSBOOTPROTO="dhcp"
OVSDHCPINTERFACES="eth0"
HOTPLUG=no

Thanks,
Guru

>
> 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 at redhat.com>
> ---
>  rhel/etc_sysconfig_network-scripts_ifup-ovs | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> index 3f31c30..3b8bb33 100755
> --- a/rhel/etc_sysconfig_network-scripts_ifup-ovs
> +++ b/rhel/etc_sysconfig_network-scripts_ifup-ovs
> @@ -115,7 +115,12 @@ case "$TYPE" in
>         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
> --
> 1.8.4.2
>



More information about the dev mailing list