Flexible routing has now come down in price with the Raspberry Pi Compute Module 4 IoT Router Carrier Board Mini which takes a Raspberry Pi Compute Module 4 and places it on a Compute Module 4 IoT Router Carrier Board Mini.
Here is someone building a Raspberry Pi Firewall and Router with DF Robot Dual NIC with Ubuntu.