I'm trying to setup my ipv6 on my raspberry pi 4. Now when I reboot it with fritzbox set to 6to4 I can't access my raspberry any more from my network (ssh, webmin etc). Additionally I can't access the pi any more with wlan0. On the other side the pi is up, its ipv6 address would show the apache standard page!

If I reboot again with the fritzbox set to ipv4 I can access the raspberry again. What do I need to change to get it running with ip 6to4?

Thanks Marc

I've got:

root@raspberrypi:/etc#  grep -v '^[#\ ]' <dnsmasq.conf



root@raspberrypi:/etc#  grep -v '^[#\ ]' < dhcpcd.conf
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
option ntp_servers
require dhcp_server_identifier
slaac private
interface eth0
interface wlan0

route -A inet6 shows

 /sbin/route -A inet6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
localhost/128                  [::]                       U    256 2     0 lo
2002:xxxx:yyyy::/64            [::]                       U    202 1     0 eth0
fe80::/64                      [::]                       U    256 1     0 tun0
fe80::/64                      [::]                       U    256 1     0 wlan0
fe80::/64                      [::]                       U    256 1     0 eth0
[::]/0                         [::]                       !n   -1  1     0 lo
localhost/128                  [::]                       Un   0   6     0 lo
2002:xxxx:yyyy::/128           [::]                       Un   0   3     0 eth0
raspberrypi.fritz.box/128      [::]                       Un   0   3     0 eth0
fe80::/128                     [::]                       Un   0   5     0 tun0
fe80::/128                     [::]                       Un   0   3     0 wlan0
fe80::/128                     [::]                       Un   0   3     0 eth0
fe80::957:595:c08b:d0bd/128    [::]                       Un   0   3     0 eth0
fe80::411c:7d49:88da:4326/128  [::]                       Un   0   3     0 tun0
fe80::81af:f6c3:3823:9efb/128  [::]                       Un   0   2     0 wlan0
ff00::/8                       [::]                       U    256 6     0 wlan0
ff00::/8                       [::]                       U    256 1     0 tun0
ff00::/8                       [::]                       U    256 5     0 eth0
[::]/0                         [::]                       !n   -1  1     0 lo

And cat /etc/host

    root@raspberrypi:/etc# cat /etc/hosts       localhost
    ::1             localhost ip6-localhost ip6-loopback
    ff02::1         ip6-allnodes
    ff02::2         ip6-allrouters               raspberrypi

ip a

root@raspberrypi:/etc# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:ea:e8:6a brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fd00::xxxxxxxxxxxxxxx/64 scope global dynamic mngtmpaddr noprefixroute
       valid_lft 6859sec preferred_lft 3259sec
    inet6 2002:xxxxxxxxxxxxxxx/64 scope global deprecated dynamic mngtmpaddr noprefixroute
       valid_lft 1633sec preferred_lft 0sec
    inet6 fe80::xxxxxxxxxxxxxxx/64 scope link
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:ea:e8:6b brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxxxxxxxxxxxxx/64 scope link
       valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 100
    inet peer scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::xxxxxxxxxxxxxxx/64 scope link stable-privacy
       valid_lft forever preferred_lft forever
  • Thanks, @Jaromanda_X. The answers are simple: my router has the address and I'm using DHCP only on the wifi for the pi. – Marc Jan 14 at 10:03
  • Oh, wait, nevermind - fritzbox + ipv6 = tears in my experience – Jaromanda X Jan 14 at 10:36
  • Very confusing configuration and hardly understandable. You have a dual stack setup (IPv4 and IPv6). Why do you try to use 6to4? That's normally only used to transfer IPv6 packages over an IPv4 network if you cannot manage the network, e.g. on the internet. If you want to use IPv6 then you should use the IPv6 stack and configure your network to get direct access to the fritzbox with IPv6. – Ingo Jan 14 at 12:22

The following is for my RPi-4 as a my home router.

My /etc/dhcpcd.conf is essentially yours except for:

    `interface eth0
 ipv6rs                               # enable routing solicitation get the
                                      # default IPv6 route
 ia_na 1 eth0                         # request an IPv6 address
 ia_pd 1/::/64 enx0050b6eab7d6/0/64   # request a PD and assign it to enp1s0u1u2'

eth0 is to Comcast's ipv6 server and the enx.... is a USB Ethernet dongle.

This jams a 1 onto the enx ipv6 address address giving 2601:x:y:z::1 on the dongle Ethernet.

Use the command as root to see what the Ethernet interfaces(s) have assigned:

    `/sbin/dhcpcd -6 -U eth0

This -U is the key. It took me 3 months to find that detail! The -U publishes a lot of information, both IPv4 and IPv6.

dnsmasq has the builtin ability to read all files in a folder. I use the following shell script to set up the dnsmasq ipv6 SLAAC portion for my home network. This assigns IPv6 to phones, pads etc. I haven't bothered to put this in an automatic boot script yet. I log in quickly and run it by hand.

    `#!/bin/bash -xv

     base_prefix=$(/sbin/dhcpcd -6 -U eth0 | grep "dhcp6_ia_pd1_prefix1="   | cut -d '=' -f 2 | cut -d : -f 1-4 | cut -d "'" -f 2)

     #   echo $base_prefix

     # following sets up router advertizements for dnsmasq
     #   ie:  dnsmasq reads this file to get the ipv6 network ip6 base prefix numbers

     echo "dhcp-range="$base_prefix":0:0:0:500,"$base_prefix":FFFF:FFFF:FFFF:FFFF, ra-names, 150" >/etc/dnsmasq.d/router-advertise.conf

    # scanned from ifconfig enx0050b6eab7d6 device 

    link_ip=$(ip address show dev enx0050b6eab7d6 scope link | awk '/inet6 / {split($2,var,"/"); print var[1]}')
    echo "dhcp-option=option6:dns-server,[${link_ip}]"  >/etc/dnsmasq.d/local-dns-server.conf

     /etc/init.d/dnsmasq restart

    exit 0`

The SLAAC addresses timeout every 150 seconds. I also reserve 500 IPv6 address for my own use, none of which I am using. IPv6 documentation suggest you use the fdxx addresses for host IP addresses in local network.

An example of my /etc/hosts file is:

   `      ruby.lan   ruby
    fe80::xx.yy.zz      ruby6.lan   ruby6`

I haven't found a way to use a single hostname to serve up both IP numbers. In my case one of my machines is called ruby for IPv4, and ruby6 for IPv6.

I set my network MTU using dnsmasq to 1412 because of the comment at the bottom of "man pppoe". And I no longer get network stalling for movies, etc. Comcast is my ISP and their default is 1500.

  • Thanks for such an excellent and comprehensive explanation. So I would call it an almost success, last thing remaining is that I don't get an dhcp6_ia_pd1_prefix1 by /sbin/dhcpcd -6 -U eth0 – Marc Jan 15 at 14:24
  • Ok, solved it. I use dhcp6_ia_na1_ia_addr1. I had to change some setting in my fritzbox to see it. – Marc Jan 15 at 15:29
  • thanks again for that solution, it works like a charm – Marc Jan 18 at 8:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.