enable DHCP support for internal ports

applied upstream commit 490db96efaf89c63656b192d5ca287b0908a6c77
Resolves: #1027440
f38
Flavio Leitner 11 years ago
parent e03374192e
commit 64ad33f09e

@ -87,6 +87,44 @@ OVSBOOTPROTO="dhcp"
OVSDHCPINTERFACES="eth0" OVSDHCPINTERFACES="eth0"
HOTPLUG=no 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: Adding physical eth0 to ovsbridge0 described above:
==> ifcfg-eth0 <== ==> ifcfg-eth0 <==

@ -0,0 +1,90 @@
From 490db96efaf89c63656b192d5ca287b0908a6c77 Mon Sep 17 00:00:00 2001
From: Flavio Leitner <fbl@redhat.com>
Date: Tue, 14 Jan 2014 00:22:07 -0200
Subject: [PATCH] rhel: Enable DHCP support for internal ports.
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>
---
rhel/README.RHEL | 38 +++++++++++++++++++++++++++++
rhel/etc_sysconfig_network-scripts_ifup-ovs | 7 +++++-
2 files changed, 44 insertions(+), 1 deletion(-)
diff --git a/rhel/README.RHEL b/rhel/README.RHEL
index 435772f..cb6ab88 100644
--- a/rhel/README.RHEL
+++ b/rhel/README.RHEL
@@ -87,6 +87,44 @@ OVSBOOTPROTO="dhcp"
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 <==
diff --git a/rhel/etc_sysconfig_network-scripts_ifup-ovs b/rhel/etc_sysconfig_network-scripts_ifup-ovs
index 3f31c30..0ee7b21 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

@ -15,7 +15,7 @@
Name: openvswitch Name: openvswitch
Version: 2.0.0 Version: 2.0.0
Release: 3%{?dist} Release: 4%{?dist}
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the
@ -32,6 +32,7 @@ Source9: README.RHEL
Patch1: openvswitch-util-use-gcc-builtins-to-better-check-array-sizes.patch Patch1: openvswitch-util-use-gcc-builtins-to-better-check-array-sizes.patch
Patch2: openvswitch-fedora-package-fix-systemd-ordering-and-deps.patch Patch2: openvswitch-fedora-package-fix-systemd-ordering-and-deps.patch
Patch3: openvswitch-initscripts-add-tunnel-support.patch Patch3: openvswitch-initscripts-add-tunnel-support.patch
Patch4: openvswitch-rhel-Enable-DHCP-support-for-internal-ports.patch
BuildRequires: systemd-units openssl openssl-devel BuildRequires: systemd-units openssl openssl-devel
BuildRequires: python python-twisted-core python-zope-interface PyQt4 BuildRequires: python python-twisted-core python-zope-interface PyQt4
@ -102,6 +103,7 @@ causing them to function as L2 MAC-learning switches or hub.
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1
%build %build
%configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki %configure --enable-ssl --with-pkidir=%{_sharedstatedir}/openvswitch/pki
@ -281,6 +283,10 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ovsdbmonitor
%changelog %changelog
* Wed Jan 15 2014 Flavio Leitner <fbl@redhat.com> - 2.0.0-5
- Enable DHCP support for internal ports
(upstream commit 490db96efaf89c63656b192d5ca287b0908a6c77)
* Wed Jan 15 2014 Flavio Leitner <fbl@redhat.com> - 2.0.0-4 * Wed Jan 15 2014 Flavio Leitner <fbl@redhat.com> - 2.0.0-4
- disabled ovsdbmonitor packaging - disabled ovsdbmonitor packaging
(upstream has removed the component) (upstream has removed the component)

Loading…
Cancel
Save