# 6to4 with openrc is not working as expected...

## Korhul

I set up my 6to4 tunnel according to instructions in /usr/share/doc/openrc-0.7.0/net.example:

My /etc/conf.d/net looks like this:

```
config_wan="77.zzz.yyy.xxx/26"

routes_wan="default via 77.aaa.bbb.ccc"

config_lan="192.168.10.253/24"

config_tun0="10.88.254.1 netmask 255.255.255.0"

config_6to4="ip6to4"

link_6to4="wan"

rc_need_6to4="net.wan"
```

net.6to4 is symlinked to net.lo

Yet starting /etc/init.d/net.6to4 spits out:

```
* Bringing up interface 6to4

 *   ERROR: interface 6to4 does not exist

 *   Ensure that you have loaded the correct kernel module for your hardware

 * ERROR: net.6to4 failed to start

```

Using sys-apps/openrc-0.7.0, sys-apps/baselayout-2.0.1-r1 and sys-apps/iproute2-2.6.37

When i rename device to sit0 and change the configuration, it works as expected. I just want to find, if this is a bug or my misconfiguration, because documentation states, that I can name my tunnel whatever I like, if iproute2 is used.

----------

## LubosD

Did you manage to solve this? I'm having the same problem.

----------

## Korhul

No I haven't. But i really haven't tried again since. Using the variant with sit0 device. Maybe I should file a bug report about this finally.

----------

## Schnulli

-radvd

-tun6to4

-bgp

better dont use - sit0 - with IPv6 for security reasons  :Wink: 

greetz

----------

## Korhul

Schnulli: I really don't understand what to do. If only your description was less brief...

It seems that the bug is somewhere in the iproute or kernel configuration. Problem is that  even creating the tunnel by hand gives me error.

```
etamin ctibor # ip tunnel add 6to4 mode sit remote any

ioctl: No buffer space available
```

This is an error, that iproute gives you, when you try to create already existing tunnel. No matter what name I give to the tunnel (sitX, some rubbish...), it still fails. Trying to build sit driver as a module and upgrading iproute2 to the latest available now.

----------

## Schnulli

 *Korhul wrote:*   

> Schnulli: I really don't understand what to do. If only your description was less brief...
> 
> It seems that the bug is somewhere in the iproute or kernel configuration. Problem is that  even creating the tunnel by hand gives me error.
> 
> ```
> ...

 

Hi Korhul,

exactly the Kernel config, iptables/etables and Iproute2 is it what makes it working.

mostly, not seldom i dont spend enough attention to my Kernel Conf, i fail to... well.... the secret is hidden inside your config.

would you paste the section "networking" here so lets see then what can be the reason.....

Another hint.. to use the lastest Stuff (Kernel´s etc) outa there is not allways the best choice. The developer do wonderfull work... but.... sometimes it takes a while till all wanted is working that way we would like to  :Wink:  Better use something that is well known to work just fine, this will save you lots of time and grey hairs  :Wink: 

/edit

forgotten to tell you

this:

ioctl: No buffer space available

try that:

$ ip tunnel del mytunnel

$ ifup mytunnel

The Error means your Routing is wrong.....  :Wink: 

A short example:

/etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=yes

HOSTNAME=xenotime

IPV6_DEFAULTDEV="sixxs"

Here are the files I created:

/etc/sysconfig/network-scripts/ifcfg-sixxs

DEVICE="sixxs"

BOOTPROTO="none"

ONBOOT="yes"

IPV6INIT="yes"

IPV6_TUNNELNAME="SixXS"

IPV6TUNNELIPV4="xx.xx.xx.xx" # Tunnel endpoint IPv4 address

IPV6TUNNELIPV4LOCAL="xx.xx.xx.xx" # Your machine's local IPv4 address

IPV6ADDR="2001:xxxx:x:xxx::2/64" # Your machine's IPv6 endpoint address

IPV6_MTU="1280"

TYPE="sit"

source:

http://www.sixxs.net/forum/?msg=setup-981289

----------

## Korhul

Schnulli: I appreciate your input, but I find your suggestions not very helpful. My kernel configuration is pretty steady. I have changed sit from being builtin to module. This does not help. Apparently there is no way to configure it any further. As to the latest stuff thing. Baselayout and openrc are now stable. Kernel version used is quite old 2.6.36. It fails for me with stable iproute2 too. So i tried combinations of stable / unstable stuff.

 ip tunnel del sit0 fails obviously because sit0 is default device created when sit module modprobed and cannot be destroyed. And I am not sure to what extent that pasted example can help me. 6to4 is another technology used to deploy ipv6 than tunnel to ipv6 broker.

However I have made some progress myself. It appears that iproute2 doesn't like, when there are two tunnels with local as any. If I manualy add local parameter to the tunnel, it is added. See example: 

```
etamin ctibor # ip tunnel add tun6to4 mode sit remote any local any

ioctl: No buffer space available
```

doesn't work

```
ip tunnel add tun6to4 mode sit remote any local 77.XXX.XXX.XXX
```

works

```
etamin ctibor # ip tunnel show

sit0: ipv6/ip  remote any  local any  ttl 64  nopmtudisc 6rd-prefix 2002::/16 

tun6to4: ipv6/ip  remote any  local 77.xxx.xxx.xxx  ttl inherit  6rd-prefix 2002::/16
```

However gentoos init scripts, according to net.example, should be able to set up 6to4 tunnel automagicaly. I am going to finally file  buf about this. Seems like in kernel stuff or something else has changed that makes 6to4 not to work.

----------

## LubosD

Gentoo's scripts are clearly broken as they use sit0. After renaming my 6to4 script to ip6tnl0, I get this:

```
 * Bringing up interface ip6tnl0

 *   ip6to4 ...

 *     Creating 6to4 tunnel on ip6tnl0 ...

add tunnel sit0 failed: No buffer space available                                                                                                                                                                                                                        [ !! ]

 * ERROR: net.ip6tnl0 failed to start
```

This is clearly wrong. You don't do 6to4 through sit0 any more, that is obsolete.

----------

## Korhul

Bug created: https://bugs.gentoo.org/show_bug.cgi?id=372575

Feel free to join...

----------

