The Ars guide to building a Linux router from scratch
If you don't want to do all that configuration, PFSense is a good alternative. https://www.pfsense.org/download/PFSense is the same thing below the hood, but with a web front-end and plugins.Most off the shelf wireless routers work fine as an access point, but are quite bad as a router. So you can just plug your old wireless router into this thing (with DHCP etc turned off), and your whole setup will be much better.