OPNsense Forum

Archive => 23.7 Legacy Series => Topic started by: dinguz on November 10, 2023, 08:41:38 AM

Title: miniupnpd started too early in boot process?
Post by: dinguz on November 10, 2023, 08:41:38 AM
After a reboot, I see this message in the logs. Apparently, miniupnpd is started before all network interfaces are up and running, and it doesn't like that. If I manually restart it after boot, all seems well.
Would it be possible to set a slightly delayed start, or make starting conditional on all configured network interfaces being up?

2023-11-10T08:29:23 Error miniupnpd PCPSendUnsolicitedAnnounce(sockets[0]) sendto(): No route to host
2023-11-10T08:29:23 Error miniupnpd SendNATPMPPublicAddressChangeNotification: sendto(s_udp=12, port=5351): No route to host
2023-11-10T08:29:21 Error miniupnpd PCPSendUnsolicitedAnnounce(sockets[0]) sendto(): No route to host
2023-11-10T08:29:21 Notice miniupnpd Listening for NAT-PMP/PCP traffic on port 5351
2023-11-10T08:29:21 Warning miniupnpd no HTTP IPv6 address, disabling IPv6
2023-11-10T08:29:21 Notice miniupnpd HTTP listening on port 2189
2023-11-10T08:29:21 Warning miniupnpd Cannot get IP address for ext interface pppoe0. Network is down
2023-11-10T08:29:21 Error miniupnpd ioctl(s, SIOCGIFADDR, ...): Can't assign requested address
Title: Re: miniupnpd started too early in boot process?
Post by: franco on November 10, 2023, 08:57:06 AM
The 'bootup' facility the plugin uses is rather late in the boot process, but will likely not cover dynamic addressing like PPPoE. I'm not aware of anyone trying miniupnpd on non-static interfaces?


Cheers,
Franco
Title: Re: miniupnpd started too early in boot process?
Post by: dinguz on November 10, 2023, 09:09:56 AM
Well, the IP addresses are static as in they don't change, but they are assigned by my ISP via DHCP, so they are acquired late in the boot process. The startup script doesn't really need to accommodate changing addresses, it just needs to delay the start until all interfaces are up.

Edit: igmpproxy seems to have the same issue
Title: Re: miniupnpd started too early in boot process?
Post by: franco on November 10, 2023, 09:18:09 AM
But but... why do you run these services on a WAN?

The case of igmp-proxy that's not even true as it does have a 'newwanip' hook. I'm not saying it's perfect, but "same" issue it is not.
Title: Re: miniupnpd started too early in boot process?
Post by: dinguz on November 10, 2023, 09:23:06 AM
Igmpproxy is needed for IPTV, and UPnP for my children playing online games and peer-to-peer stuff. I am not aware of doing something odd though :o

Edit: you are right about igmpproxy. So maybe miniupnpd should have the 'newwanip' hook as well?
Title: Re: miniupnpd started too early in boot process?
Post by: dinguz on November 24, 2023, 10:42:58 AM
I have tested with adding miniupnpd to the newwanip hook, and this - although not perfect, as you already said - seems to work fine as a 'solution'.
So could this please be implemented in the package, so I don't have to manually edit it in each time after an upgrade?
Title: Re: miniupnpd started too early in boot process?
Post by: franco on November 24, 2023, 11:02:27 AM
Sure, here you go https://github.com/opnsense/plugins/commit/8da84037c22


Cheers,
Franco
Title: Re: miniupnpd started too early in boot process?
Post by: dinguz on November 25, 2023, 09:16:50 AM
Thanks!