Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347657 - net-misc/netifrc: iproute2 tunnel mode ipip6 not possible natively
Summary: net-misc/netifrc: iproute2 tunnel mode ipip6 not possible natively
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: netifrc Team
URL:
Whiteboard: openrc:oldnet:tunnel
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 16:04 UTC by satmd
Modified: 2014-07-19 18:21 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description satmd 2010-12-03 16:04:44 UTC
I've been trying to set up a ipip6 tunnel with the openrc provided net.* runscripts, but due to the way iproute2 works, it'll fail.

iproute2 expects ip -6 tunnel add for this to work, while the rcscript iproute2.sh does ip tunnel add "$@", not giving me a chance to place the -6.
ip tunnel will then fail with "Cannot guess tunnel mode".

My current workaround looks like this:

preup() {
	local x="ip6tunnel_${IFVAR}"
	local -a ip6tunnel="${!x}"
	if [ -n "$ip6tunnel" ] ; then
		ip -6 tunnel add ${IFVAR} $ip6tunnel
		ip link set $IFVAR up
	fi
}

I'm introducing a variable ip6tunnel_${IFVAR} to create the tunnel in preup, allowing the rcscripts to continue after that like it was a normal interface.

But really I think either iproute2 needs to fix that annoying restriction of requiering -4/-6 or the rcscrips should dynamically decide to insert -4/-6 appropriately by checking the parameters to ip. Maybe something along
ip_proto46() { if ... then echo "-4" ; else echo "-6"; fi }
and
_tunnel() {
    ip $(ip_proto46 "$@") tunnel add "$@"
}
... or something much saner than this hackish attempt. Maybe parse the arguments given in the config for a -4/-6 and insert BEFORE ip's "command" parameter. I'm not exactly sure whether I can blame iproute2 for this behavior...

You get the idea, though ;)
Comment 1 William Hubbs gentoo-dev 2010-12-06 08:19:18 UTC
Can you please attach your full /etc/conf.d/net?

Looking at the examples in /usr/share/doc/openrc-version/net.example, you should be able to configure tunnels without using -4 or -6 at all.  I would like to see what your configuration looks like.

Thanks,

William
Comment 2 satmd 2010-12-07 01:28:39 UTC
My /etc/conf.d/net - with replaces ips and named:

config_ipip6_hostB="10.1.0.2/32"
ip6tunnel_ipip6_hostB="mode ipip6 remote 2a01:101::1 local 2a01:102::1 ttl 64"
routes_ipip6_hostB=("10.1.0.1/32")

ip6tunnel_* using my workaround code, but I'd expect regular iptunnel_* to do the same.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-12-12 02:08:46 UTC
Updating whiteboard to track bugs.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-02-21 09:56:53 UTC
Fixed in OpenRC git commit 2048004.
Comment 5 James Taylor 2014-07-18 15:37:32 UTC
Just came across another issue relevant to this bug, in the source the "ip4ip6" tunnel type is missing from the checks. This is the same as ipip6, but it should still take the explicit format.