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.6-iproute2/etc/conf.d/net (+10 lines)
Lines 68-73 Link Here
68
#	"default via 192.168.0.1"
68
#	"default via 192.168.0.1"
69
#	)
69
#	)
70
70
71
# The following will set up a GRE tunnel as interface vpn0. The interface is
72
# configured separately using ipaddr_vpn0 and iproute_vpn0
73
# iptunnel_vpn0="mode gre remote 207.170.82.1 key 0xffffff ttl 255"
74
# ipaddr_vpn0=(
75
#	"192.168.0.2 peer 192.168.1.1"
76
#	)
77
# iproute_vpn0=(
78
#	"192.168.1.0/24 via 192.168.1.1"
79
#	)
80
71
# For DHCP set ipaddr_eth? to "dhcp"
81
# For DHCP set ipaddr_eth? to "dhcp"
72
# For passing options to dhcpcd use dhcpcd_eth?
82
# For passing options to dhcpcd use dhcpcd_eth?
73
# ipaddr_eth0=("dhcp")
83
# ipaddr_eth0=("dhcp")
(-)rc-scripts-1.4.6-iproute2/init.d/net.eth0 (+15 lines)
Lines 55-60 Link Here
55
	# iproute2 style config vars
55
	# iproute2 style config vars
56
	eval ipaddr_IFACE=( \"\$\{ipaddr_$iface\[@\]\}\" )
56
	eval ipaddr_IFACE=( \"\$\{ipaddr_$iface\[@\]\}\" )
57
	eval iproute_IFACE=( \"\$\{iproute_$iface\[@\]\}\" )
57
	eval iproute_IFACE=( \"\$\{iproute_$iface\[@\]\}\" )
58
	eval iptunnel_IFACE=\"\$\{iptunnel_${iface}\}\"
58
		
59
		
59
	# BACKWARD COMPATIBILITY: populate the ifconfig_IFACE array
60
	# BACKWARD COMPATIBILITY: populate the ifconfig_IFACE array
60
	# if iface_IFACE is set (fex. iface_eth0 instead of ifconfig_eth0)
61
	# if iface_IFACE is set (fex. iface_eth0 instead of ifconfig_eth0)
Lines 85-90 Link Here
85
	local IFACE=${1} i x
86
	local IFACE=${1} i x
86
	checkconfig || return 1
87
	checkconfig || return 1
87
	
88
	
89
	# Do ip tunnel if present in configuration
90
	if [[ -z "$(/sbin/ip tunnel show ${1})" && -n ${iptunnel_IFACE} ]]; then
91
		ebegin "Configuring tunnel ${IFACE}"
92
		/sbin/ip tunnel add ${IFACE} ${iptunnel_IFACE} &>${devnull}
93
		eend $? || return $?
94
	fi	
95
	
88
	# Do dhcp if it is enabled in config
96
	# Do dhcp if it is enabled in config
89
	if [[ ${ifconfig_IFACE} = dhcp ]] || [[ ${ipaddr_IFACE} = dhcp ]]; then
97
	if [[ ${ifconfig_IFACE} = dhcp ]] || [[ ${ipaddr_IFACE} = dhcp ]]; then
90
		# Check that eth0 was not brought up by the kernel ...
98
		# Check that eth0 was not brought up by the kernel ...
Lines 250-255 Link Here
250
		/sbin/ip link set dev ${IFACE} down &>${devnull}
258
		/sbin/ip link set dev ${IFACE} down &>${devnull}
251
		eend $?
259
		eend $?
252
	fi
260
	fi
261
262
	# Try to destroy tunnel
263
	if [[ -n "$(/sbin/ip tunnel show ${IFACE})" ]]; then
264
		ebegin "Destroying tunnel ${IFACE}"
265
		/sbin/ip tunnel del ${IFACE} &>${devnull}
266
		eend $?
267
	fi
253
	return 0
268
	return 0
254
}
269
}
255
270

Return to bug 50765