6-in-4 tunnel wan6 Command failed: Unknown error

Dear community,

I am trying to set up a 6-in-4 tunnel to HE (tunnelbroker.net). I also configured a cron job to send periodic update request (every hour) for WAN IP. I see this every few seconds in the log:

Fri Jan 29 17:50:10 2021 user.notice 6in4-wan6: update 1/3: nochg <wan IP>
Fri Jan 29 17:50:10 2021 user.notice 6in4-wan6: updated
Fri Jan 29 17:50:10 2021 daemon.notice netifd: Interface 'wan6' is now down
Fri Jan 29 17:50:10 2021 daemon.notice netifd: Interface 'wan6' is setting up now
Fri Jan 29 17:50:10 2021 daemon.notice netifd: wan6 (10841): **Command failed: Unknown error**

It seems the tunnel update is successful, but what could be the Command failed: Unknown error? Here is the important part of my /etc/config/network:

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '64'
        option ip6hint '1'
        option ip6addr 'x:x:x:x::1/64'
        list dns 'x.x.x.x'
        list dns 'y.y.y.y'

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth1'
        option proto '6in4'
        option tunlink 'wan'
        option peeraddr 'w.w.w.w'
        option ip6addr 'x:x:x:x::2/64'
        option ip6prefix 'y:y:y:y::/64'
        option tunnelid 'zzzz'
        option username 'username'
        option mtu '1280'
        option force_link '1'
        option updatekey 'updatekey'
        option password 'password'

Thanks in advance.

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.
grafik
Please edit your post accordingly. Thank you! :slight_smile:

You should either use the assign+hint or the addr, not both. Since you have been delegated a /64 the hint doesn't make much difference.

I am pretty sure the ifname is not needed in 6in4 tunnel.

This is not needed as you have configured tunnel_id, user, and pass.

3 Likes

Thanks for the suggestions. I removed ip6assign, ip6hint and ifname options from section 'wan6', but it doesn't make any difference.
How can I find out what command failed in netifd daemon for wan6? I tried procd_set_param command /sbin/netifd -l 7 in /etc/init.d/network, but I could not make up anything from it.

you can stick some 'set -x' at the top or in diligent places in;

/lib/netifd/proto/6in4.sh or maybe /lib/netifd/netifd-proto.sh

be prepared for lots of json spam tho' ( note: there is some ustream stuff in 6in4 that is noteworthy )

2 Likes

I just tried to setup one too. Same error. It's the ubus call failing

Feb  5 16:09:20 openwrt netifd: wan6 (7626): + ubus call network.interface notify_proto '{ "action": 0, "ifname": "6in4-wan6", "link-up": true, "tunnel": { "mode": "sit", "mtu": 1280, "ttl": 64, "local": "10.0.0.1", "remote": "10.0.0.2" },  "keep": false, "ip6addr": [ { "ipaddr": "aaaa:bbbb:c:1::2", "mask": "64" } ], "routes6": [ { "target": "::", "netmask": "0", "source": "aaaa:bbbb:c:1::2\/64" }, { "target": "::", "netmask": "0", "source": "aaaa:bbbb:dddd:eeee::\/64" } ],           "ip6prefix": [ "aaaa:bbbb:dddd:eeee::\/64" ], "interface": "wan6" }'
Feb  5 16:09:20 openwrt netifd: wan6 (7626): Command failed: Unknown error

Real IP addresses all substituted for placeholders, of course

1 Like

So I found what was causing this for me, but not sure if it's going to solve your problem. I noticed that sit.ko was not loaded on my machine, which was causing the error.

However kmod-sit was actually installed - it just turned out to be an empty ipk for some reason.

I rebuilt everything and it built a non-empty kmod-sit ipk and now it works fine for me.

2 Likes

I have the same issue. lsmod | grep sit returned nothing. modprobe sit neither did. Unfortunately I have no experience in image building. My platform is Banana Pi BPI-R64. Could anybody help me?

In your private message to me, you said

Same here. sit.ko is missing for me, too. My kernel is 5.4.86, built not by me. I am not experienced in this job. I just loaded the latest snaphot and added the necessary packages. Maybe I made a mistake and added the 5.4.94 kernel too. Since then I can add only packages made for the 5.4.94 kernel. But kmod-sit does not make anything, lsmod | grep sit is empty, and no change after modprobe sit.
Would it be possible somehow for you to share your image? Then I would copy it from Ubunto with dd to my mmcblk0. This is what I have done with the current image, and it works mostly, less 6in4. Do you use Google drive? You could share your image there.
Basically I need the only following packages: 6in4, p910nd, banip. I have problem only with 6in4.
I forgot to add: my platform is Banana Pi BPI-R64.

This is the problem of course. I can't share my image as it's not the same architecture. I use an x86_64. You need to get the latest snapshot and do a sysupgrade as you can't mix kmod packages from a different kernel - they need to be an exact match to the kernel.

1 Like

I bring up this issue again. Now I have a snapshot kernet 5.10.39 and 6in4 is installed. In fact, the HE tunnel worked perfectly. But sometimes it does not work, without any change from my part. When it does not work, I get this in the log:

Sat May 29 17:20:16 2021 user.notice 6in4-wan6: update 1/3: nochg xx.yy.zz.ww
Sat May 29 17:20:16 2021 user.notice 6in4-wan6: updated
Sat May 29 17:20:16 2021 daemon.notice netifd: Interface 'wan6' is now down
Sat May 29 17:20:16 2021 daemon.notice netifd: Interface 'wan6' is setting up now
Sat May 29 17:20:16 2021 daemon.notice netifd: wan6 (1824): Command failed: Unknown error

I really don't know how can I troubleshoot this. The wan6 interface goes up and down every 20 seconds or so, but sometimes it does it every 2 seconds. I created a cron job for updating the HE tunnel my IP address, this job runs every 30 minutes. Any ideas welcome.

looks like some sort of 6proto deadlock/flapping on conflict(assignment overriden or such)...

place 'set -x' in /lib/netifd/proto/... 6in4.sh

1 Like

It seems my wan6 interface disappeared. At least it shows up in LuCi, but not in ifconfig.
I removed the WAN6 interface in LuCi, and then created it again. But I don't have any 6in4-wan6 device or any wan6 interface.

ok... my hypothesis is likely wrong then... not familiar with 6in4 config so unable to provide sane defaults...

I can confirm that this only happens with kernel 5.10, but not with 5.4.

Now I am on kernel 5.10.41 for a snapshot image. My 6in4 tunnel has been working fine - until now. The 6in4-wan6 device is present in LuCi. Also my wan6 interface is there, but the CLI does not show either of them. What can I check?

Edit: it works again after rebooting.

Did anyone figure out a root cause? I'm hitting this myself. Reboot temporarily fixes it, but problem returns.

Seems to be fixed: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=0530c490ee0091cfb97de2aa209bbb73412cca6c

1 Like

I think it's netifd's bug, and that "fix" does not fix the cause. Even on kernel 5.4, I can see multiple threads update the same tunnel IP in system log.

Since you seem to have done some research already, can you report a bug?

It has been working for me for 47 days. I am still on the 5.10.41 snapshot image. I have no idea why it had issues in the past, and why it does not have any so far.

That works for me, thanks !