Why won't my port stay open?

I set up minecraft servers and i want to run a public one. But i can't. The port closes after a few hours every time i open it. And its hard because i have to reset the modum every time to re open it. I have to reset the modem because the XFINITY NETGEAR Login expires. It just doesn't load. It works after i reset it though. How can i keep my port open, without having to reset it constantly? (Yes i know how to genuinely portforward)

If you know how to genuinely portforward and all is correct there…

Then that means the port is closing on the Computer… Check their, make sure the application is listening and no other application is listening on same port…

Check also the Firewall of the computer/server