When I retire my desktop PC, the old parts become my router. If you have two network ports, it can do it.
To warrant the power bill, it’s also a NAS, NVR, mail server, print server and web server.
All my Wifi APs are various home routers flashed with OpenWRT.