Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 50765 | Differences between
and this patch

Collapse All | Expand All

(-)rc-scripts-1.4.12-vanilla/etc/conf.d/net (+10 lines)
Lines 32-34 Link Here
32
#
32
#
33
#gateway="eth0/192.168.0.1"
33
#gateway="eth0/192.168.0.1"
34
34
35
# To create GRE/IPIP tunnels uncomment and change below;
36
# you will need to create /etc/net.vpn0 as symlink to /etc/net.eth0
37
#
38
# GRE tunnel:
39
#iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffffff ttl 255"
40
#iface_vpn0="192.168.0.2 pointopoint 192.168.1.2"
41
#
42
# IPIP tunnel:
43
#iptunnel_vpn0="mode ipip remote 207.170.82.2 ttl=255"
44
#iface_vpn0="192.168.0.2 pointopoint 192.168.2.2"
(-)rc-scripts-1.4.12-vanilla/init.d/net.eth0 (+28 lines)
Lines 52-58 Link Here
52
	local i iface="${1//\./_}"
52
	local i iface="${1//\./_}"
53
53
54
	status_IFACE="$(ifconfig ${1} 2>${devnull} | gawk '$1 == "UP" {print "up"}')"
54
	status_IFACE="$(ifconfig ${1} 2>${devnull} | gawk '$1 == "UP" {print "up"}')"
55
	status_TUNNEL="$(/sbin/iptunnel show ${1})"
55
	eval vlans_IFACE=\"\$\{iface_${iface}_vlans\}\"
56
	eval vlans_IFACE=\"\$\{iface_${iface}_vlans\}\"
57
	eval iptunnel_IFACE=\"$\{iptunnel_${iface}\}\"
56
	eval ifconfig_IFACE=( \"\$\{ifconfig_$iface\[@\]\}\" )
58
	eval ifconfig_IFACE=( \"\$\{ifconfig_$iface\[@\]\}\" )
57
	eval dhcpcd_IFACE=\"\$\{dhcpcd_$iface\}\"
59
	eval dhcpcd_IFACE=\"\$\{dhcpcd_$iface\}\"
58
	eval routes_IFACE=( \"\$\{routes_$iface\[@\]\}\" )
60
	eval routes_IFACE=( \"\$\{routes_$iface\[@\]\}\" )
Lines 88-93 Link Here
88
	local IFACE=${1} i x retval
90
	local IFACE=${1} i x retval
89
	checkconfig || return 1
91
	checkconfig || return 1
90
92
93
	# Tunnel configuration detected; run iptunnel
94
	if [[ -z ${status_TUNNEL} && -n ${iptunnel_IFACE} ]]; then
95
		ebegin "Configuring tunnel ${IFACE}"
96
		/sbin/iptunnel add ${IFACE} ${iptunnel_IFACE}
97
		eend 0
98
	fi
99
	
91
	if [[ ${ifconfig_IFACE} != dhcp ]]; then
100
	if [[ ${ifconfig_IFACE} != dhcp ]]; then
92
		# Show the address, but catch if this interface will be inet6 only
101
		# Show the address, but catch if this interface will be inet6 only
93
		i=${ifconfig_IFACE%% *}
102
		i=${ifconfig_IFACE%% *}
Lines 214-219 Link Here
214
		ebegin "Bringing ${IFACE} down"
223
		ebegin "Bringing ${IFACE} down"
215
		ifconfig ${IFACE} down &>/dev/null
224
		ifconfig ${IFACE} down &>/dev/null
216
		eend 0
225
		eend 0
226
227
		# Try to tear down tunnel
228
		# setup_vars doesn't get to run, build status_TUNNEL 
229
		status_TUNNEL="$(/sbin/iptunnel show ${IFACE})"
230
		if [[ -n ${status_TUNNEL} ]]; then
231
			ebegin "Destroying tunnel ${IFACE}"
232
			/sbin/iptunnel del ${IFACE}
233
			eend
234
		fi
235
217
		return 0
236
		return 0
218
	fi
237
	fi
219
238
Lines 252-257 Link Here
252
		eend 0
271
		eend 0
253
	done
272
	done
254
273
274
	# Try to tear down tunnel
275
	# setup_vars doesn't get to run, build status_TUNNEL 
276
	status_TUNNEL="$(/sbin/iptunnel show ${IFACE})"
277
	if [[ -n ${status_TUNNEL} ]]; then
278
		ebegin "Destroying tunnel ${IFACE}"
279
		/sbin/iptunnel del ${IFACE}
280
		eend
281
	fi
282
	
255
	return 0
283
	return 0
256
}
284
}
257
285

Return to bug 50765