From 305a0886a6a0456bf02e7b1e5a070a1e56af7d99 Mon Sep 17 00:00:00 2001 From: Flavio Leitner Date: Mon, 28 Oct 2013 17:40:47 -0200 Subject: [PATCH] rhel: Option to create tunnel through ifcfg scripts. applied upstream commit 7b75828bf5654c494a53fa57be90713c625085e2 Signed-off-by: Flavio Leitner --- README.RHEL | 19 +++++++++++++++++++ ifdown-ovs | 2 +- ifup-ovs | 5 +++++ openvswitch.spec | 6 +++++- 4 files changed, 30 insertions(+), 2 deletions(-) mode change 100644 => 100755 ifdown-ovs mode change 100644 => 100755 ifup-ovs diff --git a/README.RHEL b/README.RHEL index ba2774a..435772f 100644 --- a/README.RHEL +++ b/README.RHEL @@ -23,6 +23,8 @@ assignments. The following OVS-specific variable names are supported: * "OVSBond", if is an OVS bond. + * "OVSTunnel", if is an OVS tunnel. + - OVS_BRIDGE: If TYPE is anything other than "OVSBridge", set to the name of the OVS bridge to which the port should be attached. @@ -39,6 +41,12 @@ assignments. The following OVS-specific variable names are supported: - BOND_IFACES: For "OVSBond" interfaces, a list of physical interfaces to bond together. + - OVS_TUNNEL_TYPE: For "OVSTunnel" interfaces, the type of the tunnel. + For example, "gre", "vxlan", etc. + + - OVS_TUNNEL_OPTIONS: For "OVSTunnel" interfaces, this field should be + used to specify the tunnel options like remote_ip, key, etc. + Note ---- @@ -125,6 +133,17 @@ DEVICE=gige-* ONBOOT=yes HOTPLUG=no +An Open vSwitch Tunnel: + +==> ifcfg-gre0 <== +DEVICE=ovs-gre0 +ONBOOT=yes +DEVICETYPE=ovs +TYPE=OVSTunnel +OVS_BRIDGE=ovsbridge0 +OVS_TUNNEL_TYPE=gre +OVS_TUNNEL_OPTIONS="options:remote_ip=A.B.C.D" + Reporting Bugs -------------- diff --git a/ifdown-ovs b/ifdown-ovs old mode 100644 new mode 100755 index e346f11..2a3d8d2 --- a/ifdown-ovs +++ b/ifdown-ovs @@ -50,7 +50,7 @@ case "$TYPE" in retval=$? ovs-vsctl -t ${TIMEOUT} -- --if-exists del-br "$DEVICE" ;; - OVSPort|OVSIntPort|OVSBond) + OVSPort|OVSIntPort|OVSBond|OVSTunnel) ${OTHERSCRIPT} ${CONFIG} $2 retval=$? ovs-vsctl -t ${TIMEOUT} -- --if-exists del-port "$OVS_BRIDGE" "$DEVICE" diff --git a/ifup-ovs b/ifup-ovs old mode 100644 new mode 100755 index 280d7fd..f60c09b --- a/ifup-ovs +++ b/ifup-ovs @@ -125,6 +125,11 @@ case "$TYPE" in ${OTHERSCRIPT} ${CONFIG} ${2} OVSINTF=${DEVICE} /sbin/ifup "$OVS_BRIDGE" ;; + OVSTunnel) + ifup_ovs_bridge + ovs-vsctl -t ${TIMEOUT} -- --may-exist add-port "$OVS_BRIDGE" "$DEVICE" $OVS_OPTIONS -- set Interface "$DEVICE" type=$OVS_TUNNEL_TYPE $OVS_TUNNEL_OPTIONS ${OVS_EXTRA+-- $OVS_EXTRA} + ${OTHERSCRIPT} ${CONFIG} ${2} + ;; *) echo $"Invalid OVS interface type $TYPE" exit 1 diff --git a/openvswitch.spec b/openvswitch.spec index a9d15dc..1df7e4b 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -19,7 +19,7 @@ Name: openvswitch Version: 1.11.0 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Open vSwitch daemon/database/utilities # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the @@ -273,6 +273,10 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/ovsdbmonitor %changelog +* Mon Oct 28 2013 Flavio Leitner - 1.11.0-8 +- applied upstream commit 7b75828bf5654c494a53fa57be90713c625085e2 + rhel: Option to create tunnel through ifcfg scripts. + * Mon Oct 28 2013 Flavio Leitner - 1.11.0-7 - applied upstream commit 32aa46891af5e173144d672e15fec7c305f9a4f3 rhel: Set STP of a bridge during bridge creation.