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 ;)
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
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.
Updating whiteboard to track bugs.
Fixed in OpenRC git commit 2048004.
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.