You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/09/27 06:58:03 UTC

[11/33] git commit: CS-15094: Fix multiply vlan of redundang router

CS-15094: Fix multiply vlan of redundang router

This fix would work because:
1. When booting up the router, there is possible that no ip information have
been set for the interface(CS would do it after confirm router is up), so the
interface isn't associate with any ip, then ifconfig cannot work. We have to use
ifup, this is especially true for the first router become master.

2. After booting up phase, the ip would be associated with interfaces, then we
can use ifconfig to bring them up.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/4f4b1f56
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4f4b1f56
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4f4b1f56

Branch: refs/heads/4.0
Commit: 4f4b1f56eef37ffe2b46b66a13131a2e8b7599b1
Parents: 705481b
Author: Sheng Yang <sh...@citrix.com>
Authored: Mon Sep 24 12:06:18 2012 -0700
Committer: Edison Su <di...@gmail.com>
Committed: Wed Sep 26 21:54:32 2012 -0700

----------------------------------------------------------------------
 .../root/redundant_router/enable_pubip.sh.templ    |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4f4b1f56/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ
----------------------------------------------------------------------
diff --git a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ
index ec5905d..ccdef0b 100644
--- a/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ
+++ b/patches/systemvm/debian/config/root/redundant_router/enable_pubip.sh.templ
@@ -21,8 +21,14 @@ set -e
 ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist
 while read i
 do
-    ifdown $i
-    ifup $i
+    if [ "$i" == "eth2" ]
+    then
+        ifdown $i
+        ifup $i
+    else
+        ifconfig $i down
+        ifconfig $i up
+    fi
 done < /tmp/iflist
 ip route add default via [GATEWAY] dev eth2 && \
 service cloud-passwd-srvr restart && \