OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • States not reset after internet reconnect since 23.1
« previous next »
  • Print
Pages: [1]

Author Topic: States not reset after internet reconnect since 23.1  (Read 838 times)

Yoshi-DE

  • Newbie
  • *
  • Posts: 12
  • Karma: 1
    • View Profile
States not reset after internet reconnect since 23.1
« 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
Logged

Yoshi-DE

  • Newbie
  • *
  • Posts: 12
  • Karma: 1
    • View Profile
Re: States not reset after internet reconnect since 23.1
« Reply #1 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)   

Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17748
  • Karma: 1620
    • View Profile
Re: States not reset after internet reconnect since 23.1
« Reply #2 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
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 23.1 Legacy Series »
  • States not reset after internet reconnect since 23.1
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2