0

I am trying to use Raspberry Pi Zero 2 W as an IPV6 router . I have a usb wifi adapter (Interface Wlan1 ) facing wan . The inbuilt wifi (Wlan0) is facing LAN with hostapd running on this interface . I have no problem with IPV4 , everything works fine .I LAN clients get IPV4 address . But the system if unable to provide IPV6 address to the clients.

Here is my dhcpcd.conf :

hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option interface_mtu
require dhcp_server_identifier
slaac private
debug
logfile /home/pi/dhcpcd.log
noipv6rs
waitip 6
interface wlan1
        option rapid_commit
        ipv6rs
        ia_na 0
        ia_pd 1 wlan0/0
interface wlan0
        nohook wpa_supplicant
        nogateway
        static ip_address=10.10.0.1/24
        static routers=10.10.0.0
        static domain_name_servers=8.8.4.4 8.8.8.8

hostapd.conf

interface=wlan0
driver=nl80211

hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
ignore_broadcast_ssid=0

auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

ssid=*******
wpa_passphrase=*******

dnsmasq.conf

interface=wlan0       # Use interface wlan1
listen-address=10.10.0.1   # Specify the address to listen on
#bind-interfaces      # Bind to the interface
server=8.8.8.8       # Use Google DNS
domain-needed        # Don't forward short names
bogus-priv           # Drop the non-routed address spaces.
dhcp-range=10.10.0.50,10.10.0.150,12h # IP range and lease time

To me the problem seems to be with dhcpcd settings , as pi receives router advertisement with ipv6 prefix and assigns IPV6 address to wlan1 but doesn't assign any IPV6 address to wlan0 (LAN interface) . Here is dhcpcd log :

Jan 31 14:17:46 [1439]: dhcpcd-8.1.2 starting
Jan 31 14:17:46 [1439]: udev: starting
Jan 31 14:17:46 [1439]: dev: loaded udev
Jan 31 14:17:46 [1439]: wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
Jan 31 14:17:46 [1439]: wlan0: connected to Access Point `'
Jan 31 14:17:46 [1439]: wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
Jan 31 14:17:46 [1439]: wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
Jan 31 14:17:46 [1439]: wlan1: connected to Access Point `'
Jan 31 14:17:46 [1439]: wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
Jan 31 14:17:46 [1439]: DUID 00:01:00:01:2d:01:4e:61:d8:3a:dd:65:09:0b
Jan 31 14:17:46 [1439]: wlan0: IAID dd:65:09:0b
Jan 31 14:17:46 [1439]: wlan0: using ClientID 01:d8:3a:dd:65:09:0b
Jan 31 14:17:46 [1439]: wlan0: using static address 10.10.0.1/24
Jan 31 14:17:46 [1439]: wlan0: adding IP address 10.10.0.1/24 broadcast 10.10.0.255
Jan 31 14:17:46 [1439]: wlan0: adding route to 10.10.0.0/24
Jan 31 14:17:47 [1439]: wlan0: ARP announcing 10.10.0.1 (1 of 2), next in 2.0 seconds
Jan 31 14:17:47 [1439]: wlan0: executing `/lib/dhcpcd/dhcpcd-run-hooks' STATIC
Jan 31 14:17:47 [1439]: waiting for an IPv6 address
Jan 31 14:17:47 [1439]: wlan1: waiting for carrier
Jan 31 14:17:49 [1439]: wlan0: ARP announcing 10.10.0.1 (2 of 2)
Jan 31 14:17:49 [1439]: wlan1: carrier acquired
Jan 31 14:17:49 [1439]: wlan1: connected to Access Point `XXXXXX'
Jan 31 14:17:49 [1439]: wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
Jan 31 14:17:49 [1439]: wlan1: IAID 24:8f:8d:b2
Jan 31 14:17:49 [1439]: wlan1: IA type 3 IAID 00:00:00:00
Jan 31 14:17:49 [1439]: wlan1: IA type 25 IAID 00:00:00:01
Jan 31 14:17:49 [1439]: wlan1: adding address fe80::5fd5:83b1:4372:ecbb
Jan 31 14:17:49 [1439]: wlan1: pltime infinity, vltime infinity
Jan 31 14:17:49 [1439]: wlan1: delaying IPv6 router solicitation for 0.7 seconds
Jan 31 14:17:49 [1439]: wlan1: delaying DHCPv6 soliciation for LL address
Jan 31 14:17:49 [1439]: wlan1: delaying IPv4 for 0.5 seconds
Jan 31 14:17:50 [1439]: wlan1: using ClientID 01:00:e0:24:8f:8d:b2
Jan 31 14:17:50 [1439]: wlan1: reading lease `/var/lib/dhcpcd/wlan1-XXXXXX.lease'
Jan 31 14:17:50 [1439]: wlan1: rebinding lease of 192.168.191.210
Jan 31 14:17:50 [1439]: wlan1: ARP announcing 192.168.191.210 (1 of 2), next in 2.0 seconds
Jan 31 14:17:50 [1439]: wlan1: sending REQUEST (xid 0x302bcf59), next in 3.8 seconds
Jan 31 14:17:50 [1439]: wlan1: acknowledged 192.168.191.210 from 192.168.191.185
Jan 31 14:17:50 [1439]: wlan1: leased 192.168.191.210 for 3600 seconds
Jan 31 14:17:50 [1439]: wlan1: renew in 1800 seconds, rebind in 3150 seconds
Jan 31 14:17:50 [1439]: wlan1: writing lease `/var/lib/dhcpcd/wlan1-XXXXXX.lease'
Jan 31 14:17:50 [1439]: wlan1: adding IP address 192.168.191.210/24 broadcast 192.168.191.255
Jan 31 14:17:50 [1439]: wlan1: adding route to 192.168.191.0/24
Jan 31 14:17:50 [1439]: wlan1: adding default route via 192.168.191.185
Jan 31 14:17:50 [1439]: wlan1: ARP announcing 192.168.191.210 (1 of 2), next in 2.0 seconds
Jan 31 14:17:50 [1439]: wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' REBOOT
Jan 31 14:17:50 [1439]: waiting for an IPv6 address
Jan 31 14:17:50 [1439]: wlan1: soliciting an IPv6 router
Jan 31 14:17:50 [1439]: wlan1: delaying Router Solicitation for LL address
Jan 31 14:17:50 [1439]: wlan1: bound, ignoring 192.168.191.210 from 192.168.191.185
Jan 31 14:17:52 [1439]: wlan1: ARP announcing 192.168.191.210 (2 of 2)
Jan 31 14:18:00 [1439]: wlan1: reading lease `/var/lib/dhcpcd/wlan1-XXXXXX.lease6'
Jan 31 14:18:00 [1439]: wlan1: soliciting a DHCPv6 lease
Jan 31 14:18:00 [1439]: wlan1: delaying SOLICIT6 (xid 0x90602f), next in 0.3 seconds
Jan 31 14:18:00 [1439]: wlan1: sending Router Solicitation
Jan 31 14:18:00 [1439]: wlan1: Router Advertisement from fe80::947c:b8ff:fe17:80
Jan 31 14:18:00 [1439]: wlan1: adding address 2409:XXXX:XXXX:343e:92c3:fe06:2398:8026/64
Jan 31 14:18:00 [1439]: wlan1: pltime 3600 seconds, vltime 3600 seconds
Jan 31 14:18:00 [1439]: wlan1: adding route to 2409:XXXX:XXXX:343e::/64
Jan 31 14:18:00 [1439]: wlan1: adding default route via fe80::947c:b8ff:fe17:80
Jan 31 14:18:00 [1439]: wlan1: waiting for Router Advertisement DAD to complete
Jan 31 14:18:00 [1439]: wlan1: No DHCPv6 instruction in RA
Jan 31 14:18:00 [1439]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 0.9 seconds
Jan 31 14:18:01 [1439]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 1.8 seconds
Jan 31 14:18:02 [1439]: wlan1: Router Advertisement from fe80::947c:b8ff:fe17:80
Jan 31 14:18:02 [1439]: wlan1: adding address 2409:XXXX:XXXX:343e:92c3:fe06:2398:8026/64
Jan 31 14:18:02 [1439]: wlan1: pltime 3600 seconds, vltime 3600 seconds
Jan 31 14:18:02 [1439]: wlan1: waiting for Router Advertisement DAD to complete
Jan 31 14:18:02 [1439]: wlan1: No DHCPv6 instruction in RA
Jan 31 14:18:03 [1439]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 3.7 seconds
Jan 31 14:18:07 [1439]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 7.1 seconds
Jan 31 14:18:11 [1439]: wlan1: Router Advertisement DAD completed
Jan 31 14:18:11 [1439]: wlan1: executing `/lib/dhcpcd/dhcpcd-run-hooks' ROUTERADVERT
Jan 31 14:18:11 [1439]: forking to background
Jan 31 14:18:11 [1493]: wlan1: sending NA for 2409:XXXX:XXXX:343e:92c3:fe06:2398:8026/64
Jan 31 14:18:11 [1439]: forked to background, child pid 1493
Jan 31 14:18:12 [1493]: wlan1: sending NA for 2409:XXXX:XXXX:343e:92c3:fe06:2398:8026/64
Jan 31 14:18:13 [1493]: wlan1: sending NA for 2409:XXXX:XXXX:343e:92c3:fe06:2398:8026/64
Jan 31 14:18:14 [1493]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 14.0 seconds
Jan 31 14:18:28 [1493]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 27.7 seconds
Jan 31 14:18:55 [1493]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 55.2 seconds
Jan 31 14:19:51 [1493]: wlan1: broadcasting SOLICIT6 (xid 0x90602f), next in 109.9 seconds

Here is tcpdump of router advertisement received to wlan1 (sudo tcpdump -vvvv -ttt -i wlan1 icmp6 and 'ip6[40] = 134' ) :

        hop limit 63, Flags [none], pref high, router lifetime 3600s, reachable time 0ms, retrans timer 0ms
          source link-address option (1), length 8 (1): 96:7c:b8:17:00:80
            0x0000:  967c b817 0080
          mtu option (5), length 8 (1):  1500
            0x0000:  0000 0000 05dc
          prefix info option (3), length 32 (4): 2409:XXXX:XXXX:343e::/64, Flags [onlink, auto], valid time 3600s, pref. time 3600s
            0x0000:  40c0 0000 0e10 0000 0e10 0000 0000 2409
            0x0010:  4052 8e17 343e 0000 0000 0000 0000
          rdnss option (25), length 24 (3):  lifetime 3600s, addr: 2409:XXXX:XXXX:343e::86
            0x0000:  0000 0000 0e10 2409 4052 8e17 343e 0000
            0x0010:  0000 0000 0086
 00:00:02.443370 IP6 (flowlabel 0x9275e, hlim 255, next-header ICMPv6 (58) payload length: 88) fe80::947c:b8ff:fe17:80 > ip6-allnodes: [icmp6 sum ok] ICMP6, router advertisement, length 88
        hop limit 63, Flags [none], pref high, router lifetime 3600s, reachable time 0ms, retrans timer 0ms
          source link-address option (1), length 8 (1): 96:7c:b8:17:00:80
            0x0000:  967c b817 0080
          mtu option (5), length 8 (1):  1500
            0x0000:  0000 0000 05dc
          prefix info option (3), length 32 (4): 2409:XXXX:XXXX:343e::/64, Flags [onlink, auto], valid time 3600s, pref. time 3600s
            0x0000:  40c0 0000 0e10 0000 0e10 0000 0000 2409
            0x0010:  4052 8e17 343e 0000 0000 0000 0000
          rdnss option (25), length 24 (3):  lifetime 3600s, addr: 2409:XXXX:XXXX:343e::86
            0x0000:  0000 0000 0e10 2409 4052 8e17 343e 0000
            0x0010:  0000 0000 0086


Please Help .

1
  • dhcpcd DOES NOT allocate IP addresses; it is a DHCP client and they are allocated by the DHCP server.
    – Milliways
    Jan 31 at 21:21

2 Answers 2

0

Ensure that IPv6 forwarding is enabled on your Raspberry Pi. You can check and enable it by editing the /etc/sysctl.conf.

The line with net.ipv6.conf.all.forwarding=1 should be uncommented.

To apply the changes : sudo sysctl -p

1
  • Thanks Mathieu for replying . Its already done . net.ipv6.conf.all.forwarding=1
    – Ajay Gupta
    Jan 31 at 10:10
0

I do not have good experience with using DHCP to assign IPv6 addresses.

In part because Google will not support DHCPv6 at all on Android devices.

Therefore you need to use SLAAC on LAN side to assign a dynamic IPv6 address to any device on your network. This is done with program radvd.

But before we go on further. My question would be if you know if you have been told you have been assigned a /48 or /56 subnet? It may be you need to use select DHCP Prefix Delegation on the DHCP settings on WAN side.

It should say somewhere on your ISP providers webpage which scheme they are using. It is possible part of your self service page.

My ISP provider uses prefix delegation, but for instance Hurricane Electric's Tunnelbroker just straight up tell you that they route a particular /48 subnet over your connection and you are free to choose how you split it up on your network.

With that information: Let's suppose you have been assigned the subnet 2001:db8:cafe::/48. That means every IPv6 address covered in that range is being routed to your Raspberry Pi Zero 2 W.

You can then create a /64 subnet for your LAN by choosing a number (aka prefix) freely in the range of 0 - ffff.

Supposed the prefix is 1 then your LAN subnet would be 2001:db8:cafe:1::/64.

If you have been assigned a /56 prefix, like 2001:db8:cafe:de::/56, then you can choose your prefix freely in the range 0 - ff. In that case a chosen prefix of 1 means your IPv6 subnet would be: 2001:db8:cafe:de01::/64.

However: You will also need to declare how IPv6 traffic is routed on you net both for traffic to any of the subnets on your network and the rest of the Internet (aka default route).

You will need use the ip -6 route and ip -6 rules commands on your Raspberry in order to get this to work.

There are plenty of guide on how to do this if you search ServerFault on how to use Ubuntu as a IPv6 router.

All the commands are the same as Raspberry Pi, since they are all Debian based.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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