Setting up IPv6 over 6rd tunnel

Hey there,
so I was kinda un/successful in setting up 6rd tunnel to my ISP. My IPv6 knowledge is rather lacking so here I am.

I already had iproute2 snippet to set it up on my PC and when I used that on my Omnia it actually worked, though that bypasses LuCI and I guess, would be prone to breaking.

The 6rd.sh script

I used: Iproute2 – NETBOX IPv6 and IPv6 Address Calculator to make it

#!/usr/bin/env sh
set -e

IFNAME=test6rd

# CUSTOMER/PUBLIC_IP=100.X.X.10

if ip link show "$IFNAME" > /dev/null; then
	echo "Cleaning up old link"
	ip addr flush dev "$IFNAME"
	ip -6 route flush dev "$IFNAME"
	ip tunnel del "$IFNAME"
fi

sleep 1

echo "Setting up link"

ip tunnel add "$IFNAME" mode sit remote 46.39.165.39 ttl 64      \
	&& ip link set  dev "$IFNAME" mtu 1280 up                           \
	&& ip -6 addr add 2a01:4240:64X:Xa::1/64 dev "$IFNAME"  \
        && ip -6 route add ::/0 dev "$IFNAME"

So I went and tried setting it up thru LuCI, which turned out to be rather difficult, the interface was not coming up and this was repeated in messages

turris netifd: Interface 'wan6' is setting up now
turris netifd: wan6 (24264): Command failed: Unknown error
turris netifd: Interface 'wan6' is now down

Though when I changed the IPv6 Prefix Length from 64 to 32 it started working.
EDIT: Forgot to mention that this is happening on HBT as well as HBL where I am now (love the dark mode)
But, I guess due to that prefix, the interface is wrong

1675: 6rd-wan6@NONE: <NOARP,UP,LOWER_UP> mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000
    link/sit 100.X.X.10 brd 0.0.0.0
    inet6 2a01:4240:64X:Xa::1/32 scope global
       valid_lft forever preferred_lft forever
    inet6 ::64X:Xa/96 scope global
       valid_lft forever preferred_lft forever

Which is completely different to what my script would produce on the omnia:

1677: test6rd@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1280 qdisc noqueue state UNKNOWN group default qlen 1000
    link/sit 0.0.0.0 peer 46.39.165.39
    inet6 2a01:4240:64X:Xa::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::c0a8:76/64 scope link
       valid_lft forever preferred_lft forever
    inet6 fe80::c0a8:101/64 scope link
       valid_lft forever preferred_lft forever

Notice differences: there is POINTOPOINT, then this line is completely different link/sit 0.0.0.0 peer 46.39.165.39 and the 6rd address should be /64 instead of /32 and another address with my IPV4 as IPv6 suffix with /96.

Anyone knows what’s up with this?
Also I am not sure if I should be able to put 64 ipv6 prefix length into LuCI configuration of 6rd tunnel, tho it fails anyway so I guess not.

My /etc/config/network currently contains this, changing the ip6prefixlen to 64 will cause the errors I described on top.

config interface 'wan6'
	option proto '6rd'
	option peeraddr '46.39.165.39'
	option ip6prefix '2A01:4240::'
	option ip6prefixlen '32'
	option ipaddr '100.X.X.10'
	option peerdns '0'
	option ttl '64'
	option mtu '1280'

Pings error out with this:

root@turris:~# ping -6 example.com
PING example.com(2606:2800:220:1:248:1893:25c8:1946 (2606:2800:220:1:248:1893:25c8:1946)) 56 data bytes
From 2a01:4240::1 (2a01:4240::1) icmp_seq=1 Destination unreachable: Address unreachable

Any help greatly appreciated!

Update: The more I am looking into it the more it seems I should go to OpenWRT forum as it looks like there is a bug.
It almost seems like IPv6 Rapid Deployment has been basically forgotten by internet.

The script you use creates a 6in4 tunnel and not a 6rd tunnel. You might want to create a IPv6-in-IPv4 (RFC4213) interface in LuCI and fill in the information from your script.

Oh
It’s even written there on the netbox tool: 6in4
How… why did I think it’s 6rd the whole time.
Thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.