OPNsense Forum

English Forums => General Discussion => Topic started by: schnipp on March 27, 2019, 07:39:30 pm

Title: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on March 27, 2019, 07:39:30 pm
Hello,

I have problems to register the IPv6 address of the firewalls WAN interface to my DynDNS operator. I got the following results:


A packet capture shows that the DynDNS client does not communicate with the server, but the log file shows the following error message, even though the WAN interface has a public IPv6 address assigned:

opnsense: /services_dyndns_edit.php: Dynamic DNS (<hostname>) There was an error trying to determine the public IP for interface - wan(ix0). Probably interface is not a WAN interface.

Update URL: https://update.spdyn.de/nic/update?hostname=xxxx&myip=%IP%&user=xxxx&pass=yyyy

Does anybody has similar problems?
Title: Re: DynDNS for IPv6 not working
Post by: schnipp on April 02, 2019, 09:43:51 pm
PPPoE (pppoe0) interface is a virtual one on top of ethernet (ix0)

The DynDNS configuration "Custom v6" tries to gather the ipv6 address from the ix0 interface instead of pppoe0 if I understand the logfiles correctly.

Has anybody successfully running DynDNS with "Custom v6" profile?
Title: Re: DynDNS for IPv6 not working
Post by: franco on April 03, 2019, 03:46:32 pm
This looks like your fix... https://github.com/opnsense/plugins/commit/007b64c5258e6e1d1

So which version of DynDNS plugin are you running?


Cheers,
Franco
Title: Re: DynDNS for IPv6 not working
Post by: schnipp on April 03, 2019, 07:35:06 pm
I use plugin version 1.13 (under Opnsense 19.1.4). So, the fix is already in place.
Title: Re: DynDNS for IPv6 not working
Post by: franco on April 03, 2019, 07:36:27 pm
Okay, let me have a closer look then.
Title: Re: DynDNS for IPv6 not working
Post by: franco on April 03, 2019, 08:05:57 pm
Apr 3 17:45:17   opnsense: /services_dyndns_edit.php: Dynamic DNS (foobar) There was an error trying to determine the public IP for interface - wan(pppoe0). Probably interface is not a WAN interface.
Apr 3 17:45:17   opnsense: /services_dyndns_edit.php: Dynamic DNS (foobar): running get_failover_interface for wan. found pppoe0
Apr 3 17:45:17   opnsense: /services_dyndns_edit.php: Dynamic DNS (foobar): IP address could not be extracted
Apr 3 17:45:17   opnsense: /services_dyndns_edit.php: Aborted IPv6 detection: no address for pppoe0
Apr 3 17:45:17   opnsense: /services_dyndns_edit.php: Dynamic DNS: updatedns() starting

Looks ok to me, but it needs "Use IPv4 connectivity" in WAN settings... Which begs the question: what is your WAN setup and is it working? oO


Cheers,
Franco
Title: Re: DynDNS for IPv6 not working
Post by: schnipp on April 03, 2019, 08:20:04 pm
My configuration:

Interface PPP (PPPoE) on top of ix0 (Ethernet):


Block private networks:yes
Block bogon networks: yes
IPv4 Configuration Type: PPPoE
IPv6 Configuration Type: SLAAC
Use IPv4 connectivity: no


I have also tested the option "Use IPv4 connectivity: yes" but saw no difference in network communication (wireshark)
Title: Re: DynDNS for IPv6 not working
Post by: franco on April 03, 2019, 08:26:32 pm
Is this a side-effect from secure IPv6 addressing?

Need ifconfig of pppoe0 and igb0 to see why that's not picking up anything.

But "saw no difference in network communication" makes me worry a bit about how IPv6 works here at all. Are you sure it works fine? Sending curl over IPv4 with IPv6 attached in the URL is not a clear confirmation.


Cheers,
Franco
Title: Re: DynDNS for IPv6 not working
Post by: schnipp on April 03, 2019, 08:48:45 pm
Do you mean "privacy extensions" with "secure IPv6" addressing? I tested first without privacy extensions and afterwards with, no difference.

But I did a test with ifconfig on the console. I removed all public IPv6 addresses from interface "pppoe0" and added one of the previously assigned public IPv6 addresses to the ethernet interface "ix0" (parent interface of "pppoe0"). Afterwards, I forced a DynDNS update for the "Custom v6" profile, which successfully registered the public IPv6 address of "ix0"

This shows that the DynDNS client tries to extract the publich IPv6 from the wrong interface (parent interface of "pppoe0" instead of "pppoe0" itself).

Additionally: Adding a second alias to "ix0" (and in a second try an additional link local address) showed that the first non link local address is extracted and used for DynDNS registration.


Edit:
With "Use IPv4 connectivity" I understand, that the IPv6 configuration is done over IPv4 or PPP-config. Maybe there is a misunderstanding. "saw no difference in network communication" means that IPv6-SLAAC is still done via IPv6 multicast.
Title: Re: DynDNS for IPv6 not working
Post by: schnipp on April 06, 2019, 09:01:21 am
I have created a bug report in github: https://github.com/opnsense/plugins/issues/1296 (https://github.com/opnsense/plugins/issues/1296)
Title: Re: DynDNS for IPv6 not working.
Post by: schnipp on April 09, 2019, 09:00:04 pm
Maybe the issue does not rely in the DynDNS plugin because I saw some more strange behavior regarding IPv6. As already mentioned the ethernet interface "ix0" is parent of the virtual ppp interface "pppoe0".


Maybe opnsense has problems to distinguish "pppoe0" from "ix0"?

Any ideas or hints?
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on April 10, 2019, 09:35:35 pm
A friend has the following cascade "ix0" -> "ix0_vlan7" -> "pppoe0" and has tested to assign a static IPv6 to the interface "pppoe0".

Again, on his opnsense installation the IPv6 address is also assigned to the parent interface of "pppoe0" which is "ix0_vlan7".
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: glasi on April 14, 2019, 04:41:40 pm
I also have had problems with IPv6 in OPNsense. Miraculously, my problems seem to have disappeared after I played around a bit with the settings DHCPv6, SLAAC and static IPv6 in the WAN interface configuration.

Currently, I'm using a dual stack configuration with IPv4 Configuration Type PPPoE and IPv6 Configuration Type SLAAC.

Nevertheless, I can confirm the schnipp's observations.


On top of that I also had issues using IPv6 as internet protocol in an IPsec configuration. In this case the link local address of the WAN interface (instead of its unique global address) has been assigned to the 'left' parameter in ipsec.conf.

Despite everything looks fine right now, I'm nonetheless worried that something is (partly) broken with regards to IPv6. Unfortunately I have not been able to reproduce the problems so far.
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on April 20, 2019, 07:56:16 pm
To me this points to SLAAC incorrectly selecting the interface when the address is grabbed or simply always defaulting to the hardware interface. It's hard to confirm without a responsive setup.


Cheers,
Franco
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on April 23, 2019, 08:28:50 pm
As I already mentioned this is not only related to SLAAC, even configuring a static IPv6 incorrectly assigns that address to the parent interface.

However, this problem does no persist permanently because registration the IPv6 address of the pppoe interface currently works fine.

Any ideas?
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on April 24, 2019, 02:28:24 am
I think I found it while reviewing something else:

https://github.com/opnsense/core/commit/fc2ea5dee

# opnsense-patch fc2ea5dee

Does that work for you?


Cheers,
Franco
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: glasi on April 25, 2019, 07:26:56 pm
Still trying to reproduce the issues...
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on April 25, 2019, 10:53:06 pm
Hi franco,

thanks, I'll check this next week and report back.
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on April 26, 2019, 05:26:26 am
This patch also indicates an issue even more so than the other one: https://github.com/opnsense/core/commit/05bb00812


Cheers,
Franco

EDIT: But might not be working. Sorry for stabbing in the dark. This is still eludes common sense somehow.
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on April 29, 2019, 07:51:04 pm
So, I tested both patches (fc2ea5dee and 05bb00812), but still noch difference in behavior. In general after boot up no IPv6 address is assigned to the pppoe interface using SLAAC, after performing a pppoe reconnect the address is properly assigned to the pppoe interface.

Further obversations:

I looks like there are still problems with identifying the correct interface and possibly some more bugs. Does anybody have an idea, how to debug the scripts running in the background?
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on April 30, 2019, 07:29:53 am
I think SLAAC assignment itself is broken away from our code somehow, but I can't easily inspect this because PPPoE and SLAAC is pretty circumstantial and I don't have access to it. :(


Cheers,
Franco
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on May 03, 2019, 06:43:56 pm
I think it is not related to SLAAC and PPPoE only, because when setting a static IPv6 address for the interface pppoe0 in the GUI, the address is assigned to the parent interface ix0. The same behavior occurs if the static IPv6 address is set for a VLAN child interface of ix0.

@franco: Do you have an idea, how to easily debug some of the scripts?
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on May 03, 2019, 07:26:04 pm
To me it seems you are describing leaving "Use IPv4 connectivity" unchecked. The setting exists for SLAAC, Static IPv6 and DHCPv6.


Cheers,
Franco
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on May 03, 2019, 07:29:09 pm
Oh, I am not sure if this option was activated with static IPv6 and DHCP. I'll do a new series of tests at end of next week and report again.
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: franco on May 03, 2019, 07:36:03 pm
Ok, and if you are on 19.1.7 can you ping me on https://github.com/opnsense/core/issues/2267 as I have all the code ready now and we can get to the bottom of it.


Cheers,
Franco
Title: Re: Strange behavior with IPv6 on PPPoE [was: DynDNS for IPv6 not working]
Post by: schnipp on May 16, 2019, 09:38:49 pm
Thanks, next monday I can start testing the pppoe patches.

Going ahead in this thread and start testing the assignment of IPv6 addresses to the network interfaces need some more time, because I am very busy at the moment.