3

Apparently, I can enable IPv6 in two ways. To test, I first confirm it's not enabled currently.

$ ping6 -c 1 ::1
socket: Address family not supported by protocol

I then enable it immediately

$ sudo modprobe ipv6

And ping6 -c 1 ::1 now works. To enable it at boot, I append ipv6 on a single line to /etc/modules, then reboot. However, it's unclear if IPv6 is working now.

$ ping6 -c 1 ::1
connect: Cannot assign requested address

N.B. it's a different error to the first one. If informative, the original enabling doesn't work now either.

$ sudo modprobe ipv6
$ ping6 -c 1 ::1
connect: Cannot assign requested address

How can I enable IPv6 at boot?

EDIT

Here are the contents of /etc/network/interfaces. It's a static IP.

auto lo

iface lo inet loopback
iface eth0 inet static
address 192.168.1.91
netmask 255.255.255.0
gateway 192.168.1.254

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Sparhawk
  • 684
  • 4
  • 18
  • 33
  • What OS? An ancient link to an answer on an obsolete OS are meaningless. – Milliways Oct 23 '16 at 09:33
  • @Milliways Oops, sorry, forgot. I added the Raspbian tag. FWIW the official FAQ suggest the same thing (I edited in that link too). – Sparhawk Oct 23 '16 at 09:34
  • Why have you put an (incorrect) ip4 static address into your file? See [How do I set up networking/WiFi/Static IP](http://raspberrypi.stackexchange.com/a/37921/8697) – Milliways Oct 23 '16 at 09:36
  • @Milliways I'm not sure which part you're referring to? The file looks pretty similar to your link. The `192.168.1.91` part? – Sparhawk Oct 23 '16 at 09:41
  • That is NOT the recommended method of setting static (which I recommend against), and is there for those who insist on using Debian networking, and is conditional on disabling `dhcpcd`. But why IP4 in a question about IP6? – Milliways Oct 23 '16 at 09:46
  • @Milliways Ah ok, I re-read your link in more detail. Basically, I had the current static-IP strategy set up years ago, and hadn't revisited it. I presumed that IPv4 and v6 could work concurrently as a dual stack. I figured that `sudo modprobe ipv6` allowed that to happen. IPv6 worked from `ping6`, and IPv4 was still working from my ssh session. However, IPv6 seemed to fail with the `/etc/modules` tactic. I couldn't care less about IPv6 generally, but I'm attempting to install `ejabberd`, and [apparently](https://github.com/jabber-at/ejabberd/issues/13#issuecomment-255361033) IPv6 is required. – Sparhawk Oct 23 '16 at 09:54
  • They do work as a dual stack. That's odd -- I just checked a pi running stock Raspbian, stock kernel, and the ipv6 module is loaded (perhaps because it is a dependency for other modules loaded because I've configured ip6tables). `ping6 ::1` works as well. Unfortunately though [my `/etc/network/interfaces` is only two lines](http://raspberrypi.stackexchange.com/q/37594/5538) (i.e., I don't use it, but I don't recommend that either) so I can't say what would be wrong there. You might try asking about this one on [Unix & Linux](http://unix.stackexchange.com/). – goldilocks Oct 23 '16 at 12:41
  • Thanks @goldilocks. It's originally a pretty old Raspbian install, which I've updated over the years, so I guess it's plausible that there are some new defaults that are different. I'll look into the different static IP config and see if that helps. – Sparhawk Oct 23 '16 at 22:01

1 Answers1

3

As of Raspbian 8/Jessie, IPv6 is enabled in the Raspbian images right from the start. There is no need to touch any configuration.

With the dhcpcd client installed, IPv6 stateless address autoconfiguration (sic!) will be used with stable semantically opaque IIDs (interface identifiers). You only need a router advertising an IPv6 prefix (or several). In addition, DNS server addresses will also be autoconfigured from the router advertisements (RA). It's perfectly fine to have the RAs set M=0 and O=0, that is, no DHCPv6.

TheDiveO
  • 1,551
  • 1
  • 9
  • 15