OpenWRT: IPv6 werkt op router, maar niet op LAN

Sinds maart afnemer van internet van Freedom i.c.m. een eigen modem. Eerst een Fortigate 60D, nu met een OpenWRT router (TP-Link Archer C5 v1.2); deze is voorzien van versie 19.07.7 en vanuit de standaard configuratie verder aangepast. We hebben hier een VDSL2-lijn, dus ik heb voor de OpenWRT router een Draytek 165 staan. IPv4 werkt goed, maar met IPv6 heb ik problemen. Vanaf de router zelf kan ik netjes pingen naar bijvoorbeeld freedom.nl, maar vanaf elk apparaat op het LAN lukt dit met IPv6 niet.

Dit is de relevante configuratie in /etc/config/network:

config device
	option name 'eth0'
	option mtu '1508'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth1.1'
	option mtu '1500'
	option proto 'static'
	option ipaddr '10.109.0.1'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option igmp_snooping '1'

config interface 'wan'
	option proto 'pppoe'
	option mtu '1508'
	option username 'fake@freedom.nl'
	option ifname 'eth0.6'
	option ipv6 'auto'
	option password '1234'
	option pppd_options 'debug'

config interface 'wan6'
	option ifname 'eth0.6'
	option proto 'dhcpv6'

De router komt netjes met een IPv4- en IPv6 adres in de lucht en ieder apparaat op het LAN wordt ook voorzien van een IPv6 adres. Maar vanaf het LAN is het maar mogelijk een paar apparaten te pingen (dit is vanaf een Linuxdoos op het LAN):

alexanderl@zfs-nas: ~ $ ip -6 route show

::1 dev lo proto kernel metric 256 pref medium
2a10:3781:XXX::/64 dev enp2s0 proto kernel metric 256 pref medium
fd53:d58d:dc92:1::/64 dev enp2s0 proto kernel metric 256 expires 7108sec pref medium
fd8d:474b:28ea::/64 dev enp2s0 proto kernel metric 256 pref medium
fe80::/64 dev enp2s0 proto kernel metric 256 pref medium
default via fe80::32b5:c2ff:fe9b:4fc2 dev enp2s0 proto ra metric 1024 expires 1415sec hoplimit 64 pref medium

Het is mogelijk om de br-lan interface van de router te pingen op zijn fe80 adres:

alexanderl@zfs-nas: ~ $ ping6 fe80::32b5:c2ff:fe9b:4fc2

PING fe80::32b5:c2ff:fe9b:4fc2(fe80::32b5:c2ff:fe9b:4fc2) 56 data bytes
64 bytes from fe80::32b5:c2ff:fe9b:4fc2%enp2s0: icmp_seq=1 ttl=64 time=0.357 ms
64 bytes from fe80::32b5:c2ff:fe9b:4fc2%enp2s0: icmp_seq=2 ttl=64 time=0.319 ms
64 bytes from fe80::32b5:c2ff:fe9b:4fc2%enp2s0: icmp_seq=3 ttl=64 time=0.305 ms
64 bytes from fe80::32b5:c2ff:fe9b:4fc2%enp2s0: icmp_seq=4 ttl=64 time=0.306 ms
64 bytes from fe80::32b5:c2ff:fe9b:4fc2%enp2s0: icmp_seq=5 ttl=64 time=0.331 ms
^C
--- fe80::32b5:c2ff:fe9b:4fc2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 80ms
rtt min/avg/max/mdev = 0.305/0.323/0.357/0.027 ms

Pingen van br-lan op zijn global adres lukt niet:

alexanderl@zfs-nas: ~ $ ping6 2a10:3781:XXXX::1

PING 2a10:3781:cc9::1(2a10:3781:XXXX::1) 56 data bytes
From 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d: icmp_seq=1 Destination unreachable: Address unreachable
From 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d: icmp_seq=2 Destination unreachable: Address unreachable
From 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d: icmp_seq=3 Destination unreachable: Address unreachable
^C
--- 2a10:3781:XXXX::1 ping statistics ---
6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 118ms
pipe 4

De neigbours table op deze machine:

alexanderl@zfs-nas: ~ $ ip -6 nei

fd8d:474b:28ea:0:6db9:3bd0:f20a:f9ff dev enp2s0 lladdr 3c:22:fb:5a:b0:53 STALE
2a10:3781:XXXX::1 dev enp2s0 FAILED
fe80::1cb6:3116:d7cb:956f dev enp2s0 lladdr 3c:22:fb:5a:b0:53 STALE
2a10:3781:XXXX:0:8027:7f5c:bfe2:7d72 dev enp2s0 lladdr 3c:22:fb:5a:b0:53 STALE
fe80::32b5:c2ff:fe9b:4fc2 dev enp2s0 lladdr 30:b5:c2:9b:4f:c2 router STALE

Dit router heeft dit adres echter wel op zijn br-lan interface staan:

root@router:~# ifconfig br-lan
br-lan    Link encap:Ethernet  HWaddr 30:B5:C2:9B:4F:C2  
          inet addr:10.109.0.1  Bcast:10.109.0.255  Mask:255.255.255.0
          inet6 addr: 2a10:3781:XXXX::1/60 Scope:Global
          inet6 addr: fe80::32b5:c2ff:fe9b:4fc2/64 Scope:Link
          inet6 addr: fd8d:474b:28ea::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:81392 errors:0 dropped:3401 overruns:0 frame:0
          TX packets:275005 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12100770 (11.5 MiB)  TX bytes:156164168 (148.9 MiB)

Waarom loopt dropped op?

Om het nog gekker te maken: dit gebeurt er als je freedom.nl pingt vanaf het LAN (op de router werkt dat dus gewoon):

alexanderl@zfs-nas: ~ $ ping6 freedom.nl

PING freedom.nl(freedom.nl (2a10:3780:2:53:185:232:98:8)) 56 data bytes
^C
--- freedom.nl ping statistics --
5 packets transmitted, 0 received, 100% packet loss, time 104ms

Dit gaat gewoon de WAN interface op de router uit:

root@router:~# tcpdump -ni pppoe-wan | grep 2a10:3780:2:53:185:232:98:8

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on pppoe-wan, link-type LINUX_SLL (Linux cooked v1), capture size 262144 bytes

18:46:00.237033 IP6 2a10:3781:cc9:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 45, length 64
18:46:00.248313 IP6 2a10:3780:2:53:185:232:98:8 > 2a10:3781:cc9:0:ea39:35ff:feee:2b2d: ICMP6, echo reply, seq 45, length 64
18:46:01.260972 IP6 2a10:3781:cc9:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 46, length 64
18:46:01.272094 IP6 2a10:3780:2:53:185:232:98:8 > 2a10:3781:cc9:0:ea39:35ff:feee:2b2d: ICMP6, echo reply, seq 46, length 64
18:46:02.284997 IP6 2a10:3781:cc9:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 47, length 64
18:46:02.296542 IP6 2a10:3780:2:53:185:232:98:8 > 2a10:3781:cc9:0:ea39:35ff:feee:2b2d: ICMP6, echo reply, seq 47, length 64
18:46:03.308992 IP6 2a10:3781:cc9:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 48, length 64
18:46:03.320117 IP6 2a10:3780:2:53:185:232:98:8 > 2a10:3781:cc9:0:ea39:35ff:feee:2b2d: ICMP6, echo reply, seq 48, length 64
18:46:04.332986 IP6 2a10:3781:cc9:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 49, length 64
18:46:04.343890 IP6 2a10:3780:2:53:185:232:98:8 > 2a10:3781:cc9:0:ea39:35ff:feee:2b2d: ICMP6, echo reply, seq 49, length 64

^C66 packets captured
73 packets received by filter
0 packets dropped by kernel     

Dit gebeurt er op interface br-lan van de router:

root@router:~# tcpdump -ni br-lan ip6

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br-lan, link-type EN10MB (Ethernet), capture size 262144 bytes

18:49:35.281227 IP6 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d > 2a10:3780:2:53:185:232:98:8: ICMP6, echo request, seq 255, length 64
18:49:35.308702 IP6 fe80::32b5:c2ff:fe9b:4fc2 > ff02::1:ffee:2b2d: ICMP6, neighbor solicitation, who has 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d, length 32
^C

2 packets captured
2 packets received by filter
0 packets dropped by kernel
5 packets dropped by interface

Op de machine op het LAN zie ik die neigbour sollicitation echter niet aankomen:

alexanderl@zfs-nas:~$ sudo tcpdump -ni enp2s0 ip6

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on enp2s0, link-type EN10MB (Ethernet), capture size 262144 bytes

18:55:44.008620 IP6 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d > 2001:888:0:5::1: ICMP6, echo request, seq 53, length 64
18:55:44.589096 IP6 fd8d:474b:28ea:0:ef18:3b3f:de9d:7936 > ff02::1:ff00:1: ICMP6, neighbor solicitation, who has fd8d:474b:28ea::1, length 32
18:55:45.032528 IP6 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d > 2001:888:0:5::1: ICMP6, echo request, seq 54, length 64
^C

3 packets captured
8 packets received by filter
0 packets dropped by kernel

Ik denk dat die neighbour sollicitation van fd8d:474b:28ea:0:ef18:3b3f:de9d:7936 er niks mee te maken heeft. Op de router heeft br-lan dat adres niet, maar fd8d:474b:28ea::1/60

Heeft iemand misschien enig idee wat hier aan de hand is of mogelijk tips geven? Ik kom er niet uit…

Kijk ook naar mogelijke firewalls die aan staan, of die niet misschien te veel (icmp) blokkeren. En let op, tcpdump laat dingen zien voordat de firewall geraakt wordt.
Dus als tcpdump een pakket laat zien, wil niet zeggen dat de firewall het (daarna) niet tegen houdt.

Allen dank voor de antwoorden. Ik vermoed dat het een firewall issue is, maar heb geen idee wat het kan zijn, want ik heb niets gewijzigd. @subbink: ik heb inderdaad wel eens ergens gelezen dat tcpdump zijn data voor de firewall oppikt.

@anon97139585: ik heb trouwens mijn configuratie grotendeels op jouw HOWTO gebaseerd. Ik neem ook tv af, maar daarvoor is nog weinig geconfigureerd. Alleen ergens in /etc/config/interfaces een igmp_snooping optie. Igmpproxy is nog niet geïnstalleerd.

Hieronder de gevraagde gegevens:

De output van ip -6 addr show van dezelfde Linuxmachine op het LAN is:

alexanderl@zfs-nas:~$ ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd53:d58d:dc92:1:ea39:35ff:feee:2b2d/64 scope global dynamic mngtmpaddr 
       valid_lft 7073sec preferred_lft 7073sec
    inet6 fd8d:474b:28ea:0:ea39:35ff:feee:2b2d/64 scope global dynamic mngtmpaddr 
       valid_lft forever preferred_lft forever
    inet6 2a10:3781:XXXX:0:ea39:35ff:feee:2b2d/64 scope global dynamic mngtmpaddr 
       valid_lft forever preferred_lft forever
    inet6 fe80::ea39:35ff:feee:2b2d/64 scope link 
       valid_lft forever preferred_lft forever

De inhoud van /etc/config/dhcp van de router is:

root@router:~# cat /etc/config/dhcp

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option filterwin2k '0'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option nonegcache '0'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option nonwildcard '1'
	option localservice '1'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'

config dhcp 'modem'
	option interface 'modem'
	option ignore '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

En ten slotte de inhoud van /etc/config/firewall:

root@router:~# cat /etc/config/firewall

config defaults
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option flow_offloading '1'
	option synflood_protect '1'

config zone
	option name 'modem'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option network 'modem'

config zone
	option name 'lan'
	list network 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'

config zone
	option name 'wan'
	list network 'wan'
	list network 'wan6'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'

config forwarding
	option src 'lan'
	option dest 'wan'

config forwarding
	option src 'lan'
	option dest 'modem'

config rule
	option name 'Allow NTP from modem'
	option src 'modem'
	option src_ip '192.168.1.1'
	option family 'ipv4'
	option dest_port '123'
	option proto 'udp'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-IGMP'
	option src 'wan'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option src_ip 'fc00::/6'
	option dest_ip 'fc00::/6'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-MLD'
	option src 'wan'
	option proto 'icmp'
	option src_ip 'fe80::/10'
	list icmp_type '130/0'
	list icmp_type '131/0'
	list icmp_type '132/0'
	list icmp_type '143/0'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	list icmp_type 'router-advertisement'
	list icmp_type 'neighbour-advertisement'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-IPSec-ESP'
	option src 'wan'
	option dest 'lan'
	option proto 'esp'
	option target 'ACCEPT'

config rule
	option name 'Allow-ISAKMP'
	option src 'wan'
	option dest 'lan'
	option dest_port '500'
	option proto 'udp'
	option target 'ACCEPT'

config include
	option path '/etc/firewall.user'

firewall.user is leeg.

Ik heb inderdaad geen DHCPv6-client op de machine draaien. Het is Debian Buster machine die gebruikmaakt van ifupdown. Ik heb alleen een statisch IPv4-adres geconfigureerd. De machine krijgt dus inderdaad via SLAAC een IPv6-adres.

Ik ga proberen om een DHCPv6-client actief te maken op deze Debian machine. Ben heel benieuwd of het dan wel werkt.

Maar zou het niet een firewall issue kunnen zijn? Want als ik ping vanaf deze Debian machine dan zie je op de pppoe-wan interface van de router wel dat ping verkeer verstuurd worden en er komt een reply terug. Alleen komt die reply nooit aan bij de server.

dat lijkt

Dat lijkt meer op een routing of idd firewall issue. Zie je de reply ook op de interne interface? Als dat niet zo is, moet je kijken waarom de firewall dit niet doorstuurt (naar de juiste interface).

Nou, schiet mij maar lek… Op een Raspberry Pi (draait Ubuntu Focal) werkt IPv6 wel! Het enige wat ik kan verzinnen is dat deze op dezelfde switch zit als de router. Op m’n Macbook werkt het niet (wifi, hier zit voor het access point nog een andere switch) en boven werkt het dus ook niet (zitten 1 of 2 switches nog tussen en een access point). Heb het nog niet op een Windows 10 machine geprobeerd.

Heb de switch beneden tussen de main switch en het access point al een keertje uit- en aangezet. Dat hielp niet met de problemen op mijn Mac. Access point is ook al een paar keer herstart. Nog niet de stroom eraf gehad. Ga ik nog proberen.

Pingen werkt op Raspberry:

ubuntu@slimmemeter: ~ $ ping6 freedom.nl

PING freedom.nl(freedom.nl (2a10:3780:2:53:185:232:98:8)) 56 data bytes
64 bytes from freedom.nl (2a10:3780:2:53:185:232:98:8): icmp_seq=1 ttl=61 time=11.8 ms
64 bytes from freedom.nl (2a10:3780:2:53:185:232:98:8): icmp_seq=2 ttl=61 time=12.2 ms
64 bytes from freedom.nl (2a10:3780:2:53:185:232:98:8): icmp_seq=3 ttl=61 time=12.0 ms
^C
--- freedom.nl ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 11.805/11.994/12.163/0.146 ms

IPv6 adressen op Raspberry Pi:

ubuntu@slimmemeter:~$ ip -6 addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd8d:474b:28ea:0:ba27:ebff:fe88:f780/64 scope global mngtmpaddr noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 2a10:3781:XXXX:0:ba27:ebff:fe88:f780/64 scope global mngtmpaddr noprefixroute 
       valid_lft forever preferred_lft forever
    inet6 fd53:d58d:dc92:1:ba27:ebff:fe88:f780/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 7164sec preferred_lft 7164sec
    inet6 fe80::ba27:ebff:fe88:f780/64 scope link 
       valid_lft forever preferred_lft forever

Routeringen op RPi:

ubuntu@slimmemeter: ~ $ ip -6 route show

::1 dev lo proto kernel metric 256 pref medium
2a10:3781:XXXX::/64 dev eth0 proto ra metric 202 mtu 1500 pref medium
fd53:d58d:dc92:1::/64 dev eth0 proto ra metric 202 pref medium
fd8d:474b:28ea::/64 dev eth0 proto ra metric 202 mtu 1500 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
default via fe80::32b5:c2ff:fe9b:4fc2 dev eth0 proto ra metric 202 mtu 1500 pref medium

Neighbours op Raspberry:

ubuntu@slimmemeter: ~ $ ip -6 nei show

fe80::32b5:c2ff:fe9b:4fc2 dev eth0 lladdr 30:b5:c2:9b:4f:c2 router STALE

Zou het probleem ergens in het switch netwerk kunnen zitten? Ik heb alvast wat voorbereidingen op alle switches uitgevoerd i.v.m. multicasting en igmp snooping (voor iptv van Freedom/Canal Digitaal). Ik zal in ieder geval alle switches eens herstarten en de access points ook door ze fysiek van de stroom te halen.

Wel als de firewall op de INPUT interface staat, toch?

Beetje laat, maar misschien helpt het als je de wan6 interface config weglaat; doordat wan.ipv5 op auto staat ingesteld wordt aan de pppoe wan interface al een IPv6 adres toegekend (wan6 kun je eventueel als alias met een static IPv6 adres optuigen).