opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.25k stars 726 forks source link

Not getting IPv6 address on WAN interface at boot #7380

Open AtomicDude opened 5 months ago

AtomicDude commented 5 months ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

My WAN interface is configured as PPPoE for IPv4 and DHCPv6 for IPv6. For the DHCPv6 client configuration, the prefix is set to 56 and Use IPv4 connectivity is checked, the others are unchecked. When I reboot, I get a IPv4 address, but not an IPv6 one unless I reload/reconfigure the WAN interface. After that everything works.

To Reproduce

Expected behavior

An IPv6 address should be assigned on boot.

Describe alternatives you considered

I have created a cron script that runs frequently and check if I have an IPv6 address, if I don’t it runs rc.configure_interface wan.

Relevant log files

2024-04-13T02:53:27 Notice opnsense /usr/local/etc/rc.newwanipv6: ROUTING: keeping inet6 default route to fe80::1%pppoe0
2024-04-13T02:53:26 Notice opnsense /usr/local/etc/rc.newwanipv6: IP renewal starting (address: misconfigured, interface: wan, device: pppoe0)
2024-04-13T02:53:05 Notice opnsense /usr/local/etc/rc.newwanipv6: ROUTING: keeping inet6 default route to fe80::1%pppoe0
2024-04-13T02:53:05 Notice opnsense /usr/local/etc/rc.newwanipv6: IP renewal starting (address: misconfigured, interface: wan, device: pppoe0)
2024-04-13T02:53:02 Notice kernel <118> WAN (pppoe0) -> v4/PPPoE: x.x.x.x/32
2024-04-13T02:52:55 Notice dhcp6c dhcp6c_script: REQUEST on pppoe0 renewal
2024-04-13T02:52:55 Notice dhcp6c dhcp6c_script: REQUEST on pppoe0 executing
2024-04-13T02:52:54 Notice kernel <118>setup pppoe0 [egress only] 2024-04-13T02:52:54 Notice opnsense /usr/local/etc/rc.newwanip: plugins_configure monitor (execute task : dpinger_configure_do(,WAN_PPPOE)) 2024-04-13T02:52:54 Notice opnsense /usr/local/etc/rc.newwanip: plugins_configure monitor (,WAN_PPPOE)
2024-04-13T02:52:54 Notice kernel <118>Reconfiguring IPv6 on pppoe0
2024-04-13T02:52:53 Notice opnsense /usr/local/etc/rc.newwanip: IP renewal starting (new: x.x.x.x, old: , interface: wan, device: pppoe0, force: yes)
2024-04-13T02:52:53 Notice kernel <118>Reconfiguring IPv4 on pppoe0
2024-04-13T02:52:47 Notice opnsense /usr/local/etc/rc.newwanipv6: IP renewal deferred during boot on 'pppoe0'
2024-04-13T02:52:44 Notice opnsense /usr/local/etc/rc.newwanip: IP renewal deferred during boot on 'pppoe0' 2024-04-13T02:52:43 Notice kernel <5>ng_pppoe[15]: no matching session
2024-04-13T02:52:42 Notice kernel <5>ng_pppoe[15]: no matching session
2024-04-13T02:52:42 Notice kernel <5>ng_pppoe[15]: no matching session
2024-04-13T02:52:35 Notice kernel <6>ng0: changing name to 'pppoe0'

Environment

OPNsense 24.1.5_3-amd64 Intel(R) Xeon(R) E-2278G CPU @ 3.40GHz (2 cores, 2 threads) Intel® PRO/1000 PT Quad Port Server Adapter

iambenmitchell commented 5 months ago

I am also having IPV6 issues.

My WAN is set to DHCPv6 like it was in PFsense and I set my LAN to track.

My LAN now has a valid IP and if I SSH into the router I can ping6 google and get around 4ms latency.

But devices on my LAN are not being delegated an IP. This is with the 'Allow manual adjustment of DHCPv6 and Router Advertisements' disabled.

Upon enabling it, and trying various settings, I cannot get devices on my LAN to get an IPV6 address. I've tried DHCPv6 with all the different RA settings and rebooting after changes, but nothing.

Yet, in PFSense I was able to get IPV6 working with no problems. I must be going crazy or its broken in OPNSense

wabkia commented 4 months ago

I must be going crazy or its broken in OPNSense

you are not crazy. its been broken like this for at least a year. every time i update or restart the router for whatever reason it breaks again and its a fight between restarts, wan interface disable/enable, settings changes to get it back. my isp has perfect ipv6 support and provides a /56 prefix. opnsense falls flat on its face and i wonder if i should just find a replacement.

iambenmitchell commented 4 months ago

I must be going crazy or its broken in OPNSense

you are not crazy. its been broken like this for at least a year. every time i update or restart the router for whatever reason it breaks again and its a fight between restarts, wan interface disable/enable, settings changes to get it back. my isp has perfect ipv6 support and provides a /56 prefix. opnsense falls flat on its face and i wonder if i should just find a replacement.

My issue ended up being the bridge I was running as the LAN. I've switched back to PFsense, removed the bridge and put up with having each of my switches and sub devices be in a different subnet.

Now IPv6 is working perfectly. I get 19/20 points on https://ipv6-test.com. I am using SLAAC only too, no DHCP6 nonsense.

fichtner commented 4 months ago

All I can see is that it fails to find a primary IPv6:

https://github.com/opnsense/core/blob/81676259d357fc444a78d511f6f1b11f98d94af7/src/etc/rc.newwanipv6#L92

It would help to see what the correct address from the ISP is, but it sort of suggests you want an address but you don’t get one (ia-na) for an unknown reason.

you know, guys, there is a debug setting for dhcpv6 client to enable since these issues are always entangled with the setup and ISP behaviour.

iambenmitchell commented 4 months ago

you know, guys, there is a debug setting for dhcpv6 client to enable since these issues are always entangled with the setup and ISP behaviour.

I didn't;t have issues getting an IPv6 from my ISP via WAN, my issue was that even thought he LAN interface had a real global /64 prefix from the /56 prefix, RA AND DHCP6 were both broken.

Turns out my issue was due to using a LAN bridge. Been an issue before https://redmine.pfsense.org/issues/8429

fichtner commented 4 months ago

Sounds like a FreeBSD kernel issue with multicast forwards then if not done on purpose by the bridge implementation, perhaps a scope mismatch of link local advertisements.

AtomicDude commented 4 months ago

Hello, I've got some more logs with dhcpv6 logging set to debug when the router boots and doesn't get a wan ipv6 https://pastebin.com/a2SsvYuK. I can also post some logs after i reload services and it gets the ip if that's helpful.

wabkia commented 4 months ago

All I can see is that it fails to find a primary IPv6:

https://github.com/opnsense/core/blob/81676259d357fc444a78d511f6f1b11f98d94af7/src/etc/rc.newwanipv6#L92

It would help to see what the correct address from the ISP is, but it sort of suggests you want an address but you don’t get one (ia-na) for an unknown reason.

you know, guys, there is a debug setting for dhcpv6 client to enable since these issues are always entangled with the setup and ISP behaviour.

i suspect the problem is not on the ISP side, but i will upload logs when i have this problem again. as i said before, usually some combination of disabling ipv6 and re-enabling on the interfaces, and restarting opnsense, resolves the issue.

fichtner commented 4 months ago

some combination of disabling ipv6 and re-enabling on the interfaces, and restarting opnsense, resolves the issue

Which indicates timing inconsistencies with the ISP sometimes giving out the proper prefix and address and sometimes not depending on the previous lease state.

The fun part is the IP detection is just diagnostics since 24.1.5 which would further indicate the ISP is giving out the address/prefix sometimes, but not always.

The fact that it works for other distributions might be simply that the request rate is lower causing this to not fail as much.

Cheers, Franco

Pataps commented 1 month ago

Hi, I'm having similar issue. Also PPPoE for ipv4 and DHCP6 for ipv6 and /56 from ISP to delegated to LAN (track interface), without specific WAN ipv6.

I noticed that switching from "track interface" to "SLAAC" and back to "track interface" fixes it. I narrowed it down to dhcp6c not starting, (maybe it's a matter of services start order against PPPoE? Not sure...). Starting dhcp6c manually solves the problem in my case and ipv6 is assigned at once. @AtomicDude can you try to start dhcp6c after fresh boot and see if it solves it for you?

@fichtner Does this sound lika e bug to you?