summaryrefslogtreecommitdiff
blob: 8c93a513517bee0b26bd63f0d6bae4eaa832e16b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
commit 78ef67a523e7f2589e49a082376ee56ce1a5d76e
Author: Peter Volkov <pva@gentoo.org>
Date:   Tue Mar 31 13:03:44 2009 +0400

    Issue warning if forwarding is disabled
    
    In case forwarding is disabled let's warn user about that. This is
    alternative solution for http://bugzilla.openvz.org/show_bug.cgi?id=1079

diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in
index dc87d41..7c57370 100755
--- a/etc/init.d/vz-gentoo.in
+++ b/etc/init.d/vz-gentoo.in
@@ -128,6 +128,11 @@ start_net() {
 	ebegin "Configuring interface ${VZDEV}"
 		/sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0
 	eend $?
+
+	if [ "x$(/sbin/sysctl net.ipv4.ip_forward 2>/dev/null | awk '{print $3}')" = "x0" ]; then
+		ewarn "It looks like you have ip forwarding disabled. To make networking"
+		ewarn "available for containers, please, run sysctl -w net.ipv4.ip_forward=1"
+	fi
 }
 
 stop_net() {