summaryrefslogtreecommitdiff
blob: b07a5b301b6243b50726513050608b1b2e45034a (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
=== modified file 'etc/init.d/vz-gentoo.in'
--- etc/init.d/vz-gentoo.in	2008-11-15 09:57:13 +0000
+++ etc/init.d/vz-gentoo.in	2008-11-15 11:35:03 +0000
@@ -116,6 +116,11 @@
 	ebegin "Configuring interface ${VZDEV}"
 		/sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0
 	eend $?
+	if [ "${ENABLE_FORWARDING}" = "yes" ]; then
+		ebegin "Enabling system wide forwading (\$ENABLE_FORWARDING is set to yes)..."
+		sysctl -w "net.ipv4.ip_forward=1"
+		eend $?
+	fi
 }
 
 stop_net() {
@@ -131,6 +136,11 @@
 	for mod in ${NET_MODULES}; do
 		/sbin/modprobe -r ${mod} > /dev/null 2>&1
 	done
+	if [ "${ENABLE_FORWARDING}" = "yes" ]; then
+		ebegin "Disabling system wide forwading (\$ENABLE_FORWARDING is set to yes)..."
+		sysctl -w "net.ipv4.ip_forward=0"
+		eend $?
+	fi
 }
 
 start_ve() {

=== modified file 'etc/vz.conf'
--- etc/vz.conf	2008-11-15 09:57:13 +0000
+++ etc/vz.conf	2008-11-15 09:58:22 +0000
@@ -21,6 +21,10 @@
 # By default automatically assigned.
 #VE_ROUTE_SRC_DEV="eth0"
 
+# Uncomment to enable forwarding automatically during /etc/init.d/vz start
+# (Calls sysctl -w "net.ipv4.ip_forward=1" on start and revert on stop)
+#ENABLE_FORWARDING="yes"
+
 # Controls which interfaces to send ARP requests and modify APR tables on.
 NEIGHBOUR_DEVS=detect