check ip_forward and set to 1 41/58741/1 opnfv-6.2.0
authorwutianwei <wutianwei1@huawei.com>
Tue, 19 Jun 2018 02:52:26 +0000 (10:52 +0800)
committerHarry Huang <huangxiangyu5@huawei.com>
Wed, 20 Jun 2018 06:37:18 +0000 (06:37 +0000)
JIRA: COMPASS-600

Change-Id: I21ace213060d9d0dde7f7f4b5cf1f79d567ebeb0
Signed-off-by: wutianwei <wutianwei1@huawei.com>
(cherry picked from commit 1a1ed339b96458c483976a820e30b3a1bbb0b5d8)

deploy/network.sh

index ebe0eec..1852628 100755 (executable)
 function clear_forward_rejct_rules()
 {
     while sudo iptables -nL FORWARD --line-number|grep -E 'REJECT +all +-- +0.0.0.0/0 +0.0.0.0/0 +reject-with icmp-port-unreachable'|head -1|awk '{print $1}'|xargs sudo iptables -D FORWARD; do :; done
+    ip_forward=$(cat /proc/sys/net/ipv4/ip_forward)
+    if [ $ip_forward -eq 0 ]; then
+        sysctl -w net.ipv4.ip_forward=1
+    fi
 }
 
 function setup_bridge_net()