diff --git a/files/fuel-ha-utils/ocf/ns_vrouter b/files/fuel-ha-utils/ocf/ns_vrouter index 2ce20e04d5..21c09d04eb 100644 --- a/files/fuel-ha-utils/ocf/ns_vrouter +++ b/files/fuel-ha-utils/ocf/ns_vrouter @@ -187,6 +187,7 @@ check_ns() { local ns=$(ip netns list | awk "/${OCF_RESKEY_ns}/ {print \$1}") ocf_log debug "${LH} recieved netns list: ${ns}" [[ "$ns" != $OCF_RESKEY_ns ]] && return $OCF_ERR_GENERIC + ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1 return $OCF_SUCCESS } @@ -198,6 +199,7 @@ get_ns() { ocf_run ip netns add $OCF_RESKEY_ns rc=$? ocf_run $RUN_IN_NS /sbin/sysctl -w net.ipv4.ip_nonlocal_bind=1 + ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1 ocf_run $RUN_IN_NS ip link set up dev lo ocf_log debug "${LH} added netns ${OCF_RESKEY_ns} and set up lo" @@ -209,8 +211,6 @@ set_ns_routing() { ip netns exec "${OCF_RESKEY_ns}" ip ${@} } - ocf_run $RUN_IN_NS sysctl -w net.ipv4.ip_forward=1 - # create host-ns veth pair unless it's present ip link | grep -q '^[[:digit:]]\+:[[:space:]]\+'"${OCF_RESKEY_host_interface}"'[@:]' if [ $? -gt 0 ]; then