[solved] No IPv6 after upgrading

Started by iam, February 02, 2019, 11:11:54 PM

Previous topic - Next topic

Hmm, begins to sound like something is missing or corrupted. Have a look in System:Routes:Log Files, you should see entries for rtsold, do you see them?


It's looking like something has gone wrong with the update, and I would now consider a clean install. Note there are a couple of issues that are being corrected in 19.1.1 which is due in a couple of days. There's also likely to be a new installation archive at the same time if you wait, otherwise it would be clean install 19.1 then update to 19.1.1.


I cannot think of anything else that would stop dhcp6 from running, especially when directly send solicit is used as that forces dhcp6c to launch and once it runs it stays running unless the interface is taken down.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Quote from: marjohn56 on February 04, 2019, 09:54:54 PM
Hmm, begins to sound like something is missing or corrupted. Have a look in System:Routes:Log Files, you should see entries for rtsold, do you see them?

Yes, but the last entry is dated to July.

I'm surprised it's been working at all then.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

I'll test it again with the next releases.

By the way, do you have configured static IPv4 and OpenVPN servers? This is maybe relevant for finding the error cause.

February 05, 2019, 11:34:54 AM #20 Last Edit: February 05, 2019, 11:37:14 AM by iam
Hi,

do you have some more hints? At which point the dhcpv6 should be started normally?

Reinstalling might be a solution, but I prefer understanding and solving the problem instead of applying the sledgehammer method only.

Best,
iam

Ok I see. /var/etc/rtsold_re0_script.sh should call the dhcpv6. This works if I run the script without parameters manually:

#!/bin/sh
# this file was auto-generated, do not edit
if [ -n "${2}" ]; then
        echo ${2} > /tmp/re0_routerv6
        echo ${2} > /tmp/re0_defaultgwv6
fi
if [ -f /var/run/dhcp6c_re0.pid ]; then
        /usr/bin/logger -t dhcpd "RTSOLD script - Sending SIGHUP to dhcp6c for interface wan(re0)"
        /bin/pkill -HUP -F /var/run/dhcp6c_re0.pid
else
        /usr/bin/logger -t dhcpd "RTSOLD script - Starting dhcp6 client for interface wan(re0)"
        /usr/local/sbin/dhcp6c '-d' -c '/var/etc/dhcp6c_wan.conf' -p '/var/run/dhcp6c_re0.pid' 're0'
fi


But where should be called this script?

That script is called by RTSOLD when it receives an RA in response to its RS solicit.


An RS is generally the start of all IPv6 communications, the routers automatically find neighbours and create routes, this is why routing in IPv6 can be handled automatically.


If RTSOLD does not receive an RA then it will not run the script and dhcp6c will not run. However, if you have ticked 'Directly send solicit' ithen dhcp6c gets launched irrespective of whether or not an RA has been received. This is done because some ISPs deliberately require that a dhcp6 request is sent as well as the RS before they send an RA response.


What happens in the interfaces.inc script is shown below in a code snippet from interfaces.inc


mwexecf(
        '/usr/sbin/rtsold -p %s -O %s -R %s %s %s',
        array(
            "/var/run/rtsold_{$wanif}.pid",
            "/var/etc/rtsold_{$wanif}_script.sh",
            '/usr/bin/true', /* XXX missing proper script to refresh resolv.conf */
            empty($wancfg['adv_dhcp6_debug']) ? '-d' : '-D',
            $wanif
        )
    );


    if (isset($wancfg['dhcp6sendsolicit'])) {
        mwexec("/var/etc/rtsold_{$wanif}_script.sh");
    }


What you see above is the launch of rtsold, which will wait for the RA response to its solicit - then it will launch the rtsold script.

The second part says if 'Directly send solicit' is set ( dhcp6sendsolicit ) then run the rtsold script anyway.

In the RTSOLD script itself are two parts, you can ignore the first 'if' statement, that is setting up routes automatically, it's important, but not for what I am about to say. The second 'if / else' looks at whether dhcp6c is running or not, if it is then it sends it a SIGHUP to re-initialise it, if it is not running, and that's detected by looking for the pid file then it will start it up.

Make sense?
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

February 05, 2019, 01:51:56 PM #23 Last Edit: February 05, 2019, 01:58:40 PM by iam
Hi,

many thanks for your explanations.

Running rtsold manually with

/usr/sbin/rtsold -p /var/run/rtsold_re0.pid -O /var/etc/rtsold_re0_script.sh -R /usr/bin/true -D re0

causes an working IPv6 connection. But this don't seems repeatable at least without a reboot.

So I guess that rtsold isn't starting automatically for some reason. Where I can found interfaces.inc on the file system?

Best,
iam

EDIT: I've found out the path myself: /usr/local/etc/inc/interfaces.inc

if you go to the shell:


> ps -auxw | grep rtsold


You should get something like what is shown below... do you?




root@OPNsense:~ # ps -auxw | grep rtsold
root    10626   0.0  0.0 1057660  2616  -  Ss   12:01     0:00.03 /usr/sbin/rtsold -p /var/run/rtsold_igb0.pid -O /var/etc/rtsold_igb0_script.sh -R /usr/bin/true -D igb0
root    65097   0.0  0.0 1058012  2840  0  S+   12:57     0:00.00 grep rtsold





OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Only if I start rtsold it manually.

Finally I've solved this issue. Many thanks for your help :)

I've checked the code and found this part:

    if (!is_array($wancfg)) {
        return;
    }


Then I've read the description of the property "Use IPv4 connectivity": "Request the IPv6 information through the IPv4 PPP connectivity link."

There is no PPP connection controlled by OPNsense, so it don't make sense to activate it. So I've deactivated it and voilĂ , IPv6 is working.

February 05, 2019, 02:14:43 PM #27 Last Edit: February 05, 2019, 02:18:27 PM by marjohn56
Well that bit of code checks to see if there is a valid wan configuration array, the one the caused the bailout was this:


if (isset($wancfg['ipaddrv6'])) {
        switch ($wancfg['ipaddrv6']) {
            case 'slaac':
            case 'dhcp6':
                /* XXX why not tell the function... */
                if (isset($wancfg['dhcp6usev4iface'])) {
                    break;
                }
                interface_dhcpv6_prepare($interface, $wancfg);
                interface_dhcpv6_configure($interface, $wancfg);
                break;




Anyway, glad its fixed. Marked it [SOLVED] ..
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member