OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: Yoshi-DE on February 23, 2023, 10:47:03 PM

Title: States not reset after internet reconnect since 23.1
Post by: Yoshi-DE on February 23, 2023, 10:47:03 PM
Hi,

after Upgrade to 23.1 i noticed that the states on the second wan interface are no longerer reset, after IP renew.

I have seen that here the mechanism has been changed, and the function is now on rc.newwanip.

However the states is not reset here for my pppoe interface.

The log shows:
Quote
/usr/local/etc/rc.newwanip: IP renwal starting (new: 87.144.153.x, old: , interface: VDSL[opt6], device: pppoe0)   

here no cache ip is show.

The tmp file has the old ip

Quote
root@OPNsense:/ # cat /tmp/pppoe0_oldip
87.144.154.x

This now leads to problems with connections that always run over the second internet connection after the ip change.

Thanks,
Yoshi
Title: Re: States not reset after internet reconnect since 23.1
Post by: Yoshi-DE on February 24, 2023, 12:33:47 PM
I have now found this out.

/usr/local/etc/rc.newwanip
Quote
$cacheip_file = "/tmp/{$device}_oldip";

if (!is_ipaddr($ip)) {
    /* remove previously cached IP since it is gone */
    @unlink($cacheip_file);
    /*
     * Take care of OpenVPN and similar if you generate the event
     * to reconfigure an interface.  OpenVPN might be in tap(4)
     * mode and not have an IP address.
     */
    if (substr($device, 0, 4) != 'ovpn') {
        log_msg("Failed to detect IP for {$interface_descr}[{$interface}]", LOG_WARNING);
        return;
    }
}

The if statement is true and the cachefile is deleted.

This means that it can no longer be read for the states kill function.

As a workaround I have commented out the @unlink($cacheip_file). Then it works.

Quote
/usr/local/etc/rc.newwanip: IP renwal starting (new: 87.156.7.x, old: 87.144.15.x, interface: VDSL[opt6], device: pppoe0)   

Title: Re: States not reset after internet reconnect since 23.1
Post by: franco on February 24, 2023, 07:49:27 PM
We are working on a viable solution. The thing is your provider forces you into an address-less state which makes it harder to track. we need the cache mechanism to be able to check if the IP changes, but maybe we don't need to delete it anymore. I'm not sure. As I said still working on it.


Cheers,
Franco