5 seconds power supply backup for 12V 0.5A router
Rather than make something, it is probably best to by a mini-UPS such as this for about $25. It is designed specifically for keeping routers powered during power outages. Fits between the router and the router 12V power supply