Ars Technica: Homebrew Router using Ubuntu-server
Ars Technica has a well fleshed-out article showing you how to use off-the-shelf components and Linux to make your own router that is much more powerful than anything you can buy pre-made. Note that the hardware they use in this article is overkill for most purposes unless you have a 200 computer network you're serving. But the hardware is PC-based so any Mini-PC would work, even older PCs. What I find interesting about the article is that it goes into the details of how to configure Ubuntu-server to be the router. Let us know in the comments if you have ever turned a PC into a router or installed custom software on a router and how well it worked for you.