Skip to content

Arch linux: setting IPv6 address, if_addaddress6: Invalid argument

I have native IPv6 connectivity from my ISP, Verso Networks in Denver.

I have dhcpd running on the gateway with this config file:

hostname ironsides
allowinterfaces enp48s0
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
nohook lookup-hostname
noipv4ll
noipv6rs
interface enp48s0
   ipv6rs
   ia_na 1
   ia_pd 2 enp32s0/0

enp48s0 is connected to The Internet, enp32s0 is on my LAN. This works for the gateway box. dhcpcd acquires an address and sets default routes and such:

# ip -6 address show dev enp48s0
4: enp48s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 2604:f880:0:87:6a05:caff:fe4a:8ac7/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2591550sec preferred_lft 604350sec
    inet6 fe80::6a05:caff:fe4a:8ac7/64 scope link 
       valid_lft forever preferred_lft forever

I have radvd set to advertise /60 addresses for the prefix that dhcpcd acquires. Here's radvd.conf:

    interface enp32s0 {
            AdvSendAdvert on;
            MinRtrAdvInterval 5;
            MaxRtrAdvInterval 15;
            prefix ::/64 {
                    AdvOnLink on;
                    AdvAutonomous on;
                    AdvRouterAddr on;
            };
    };

The weird thing is that my other Arch linux box won't get an IPv6 address that radvd sends out. On the gateway box, journalctl says this:

Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): timer_handler called for enp32s0
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): ::/64 auto prefix detected on iface enp32s0
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): auto-selected prefix 2604:f880:0:8050::/60 on interface enp32s0
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): sending RA to ff02::1 on enp32s0 (fe80::6a05:caff:fe5a:3ab7), 2 options (using 56/1210 bytes)
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): enp32s0 next scheduled RA in 7.80783 second(s)
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): polling for 7.807 second(s), next iface is enp32s0
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): enp32s0 recvmsg len=56
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): enp32s0 received a packet
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): enp32s0 received RA from: fe80::6a05:caff:fe5a:3ab7 (myself)
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): processed RA on enp32s0
Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): polling for 7.807 second(s), next iface is enp32s0

On the client, for every RA that baldur (the gateway) sends out, mirabilis (the client) says this, every time baldur radvd sends RA to ff02::1 on enp32s0 (which mirabilis, the client) is on.

Nov 16 08:21:34 mirabilis dhcpcd[20783]: wlp3s0: Router Advertisement from fe80::6a05:caff:fe5a:3ab7
Nov 16 08:21:34 mirabilis dhcpcd[20783]: wlp3s0: adding address 2604:f880:0:8050:e71e:88b6:e10b:bbb3/60
Nov 16 08:21:34 mirabilis dhcpcd[20783]: wlp3s0: pltime 14400 seconds, vltime 86400 seconds
Nov 16 08:21:34 mirabilis dhcpcd[20783]: if_addaddress6: Invalid argument
Nov 16 08:21:34 mirabilis dhcpcd[20783]: wlp3s0: executing `/usr/lib/dhcpcd/dhcpcd-run-hooks' ROUTERADVERT

I've googled "if_addaddress6: Invalid argument" and I haven't come up with much.

If I set the IPv6 address "2604:f880:0:8050:e71e:88b6:e10b:bbb3/60" by hand, with ip, it works fine. Routes to The Internet, I can ping and traceroute ipv6.google.com from the client and everything.

Why won't it assign the address?

Edited 16 Nov 2017. We only hold this version.

7 points2 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
7 · 100% up
Kind
Text
ID
7dd487

Author

9
posts
43
comments
0
media
View profile

2 comments

Nov 16 08:21:34 baldur radvd[5432]: [Nov 16 08:21:34] radvd (5432): auto-selected prefix 2604:f880:0:8050::/60 on interface enp32s0

As a general rule of thumb, all on-link ranges should be /64 in v6. The point of the /60 is so that you have 16 separate /64s (...which is kinda an unjustifiably small allocation, but that's a different discussion). Perhaps more to the point, SLAAC requires /64.

Assign something like 2604:f880:0:8050::1/64 on enp32s0 rather than 2604:f880:0:8050::1/60.

1 points

I think I got it sorted out, with thanks to Dagger0 for a hint that put me on the right path.

dhcpcd.conf on the gateway has to have IPv6 config something like this:

noipv6rs
interface enp48s0
   ipv6rs
   ia_na 8ac7
   ia_pd 3ab7 enp32s0

"8ac7" is the last 2 bytes of the hardware address of enp48s0, and "3ab7" are the last two bytes of enp32s0's hardware address.

radvd.conf on the gateway machine looks like this:

interface enp32s0 {
    AdvSendAdvert on;
    MinRtrAdvInterval 5;
    MaxRtrAdvInterval 15;
    prefix ::/64 {
            AdvOnLink on;
            AdvAutonomous on;
            AdvRouterAddr on;
    };
};

I believe I had "prefix ::/60", which made radvd give out /60 prefixes. I think.

Anyway, between setting iaid values and the ::/64 change, my gateway advertised routes, delegated a prefix to the LAN NIC, and the client picks up and uses a globally-routeable IPv6 address.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.