You could also just use an old pc...
For software opnsense, pfsense, openbsd, freebsd, Linux (openwrt could be used too if you want embedded)
It is a pain to start ... But satisfying when it works :)