First I need a little information from you. Things like your current setup power inverters? Type of router using? etc. Are you comfortable with building circuits? Have an circuit skills/experience?
This can be done a few ways.
One of them is to use an inverter to drive the router and put the inverter on a small separate battery. This is not ideal because you are using the power of 2 things to control one. You could put a low voltage shutdown circuit if it is not equipped with one. You must make sure that it is always off though and doesn't cycle back on as voltage comes back. You should also put a 30 amp relay in line so that it only connects to main battery when ignition is sensed. This will prevent any damage to the main battery should the second one drain and keep the main from damaging the circuit should you have to get a jump.
Some units use a 11.2vdc off and 13vdc on so as not to cycle unless an external source provides power back to the battery. Since most batteries sit at rest around 12.5volts the inverter wouldn't turn back on until the car starts and the alternator charges the battery at above 13volts.
The other route to go and the one I might try if I were in your position, is to use a voltage regulator circuit with a low voltage sense shutdown. You could build one for probably less then 30-40 bux. Maybe less. I would have to price the parts.
Basically it would work by using a second small battery (AGM) to power it through the circuit. The battery would be recharged by a relay connected to main battery when ignition is on and would shutdown if battery voltage fell below a predetermined value.
Most routers I have seen run off of a 12volt transformer for the home. Check the one you want to use, see what the power consumption is, and post back.