Yeah, this is a great idea.
First, junk that router
The vast majority of routers these days are looking for 12 volt DC, tip positive. Build for that because it's a lot easier.
A few routers want AC power in the 9-12 volt range, but if you crack them open, incoming power's very first stop is a bridge rectifier. For this type (AC+bridge), it can accept DC voltage - the rectifier will automatically make it the correct polarity. If its AC voltage is 9-12, good chance it will work fine on 12 volt DC.
While you shop for routers, look sharply for low power draw. You can't go by nameplate, but need to look at actual power draw in actual use. You want the 12V power draws (if only you could find a Kill-a-Watt that was 12V!) looking at the 120V draw of the power block doesn't help all that much.
It really matters. Here's why.
Battery
The heart of the system will be a large battery. Large.
How do you factor battery size? Talk to the off-grid solar people, but sizing for 3 days of no sun is about right. Lead-acid batteries really do not like to be bottomed, not even deep-cycle types, so with those, size for 5 days. That's 120 hours at 1A so 120 amp hours. Couple of golf cart batteries. Hence the value of a more efficient router.
Even with no solar system whatsoever, this setup needs to work. Solar, wind, microhydro, jumping off your car, or a grid powered battery charger are just add-ons to provide makeup power.
Solar charge controller
The charge controller's job is to take the ~19 volts coming off a solar panel and buck it down to whatever voltage will correctly charge the battery without overcharging it (cooking it). There isn't one magic voltage number here, there's some black magic in proper battery charging.
Needless to say, quality matters: cheap Cheese charge controllers won't perform as well or could ruin your battery pack. I like Morningstar's $30 low-end unit, it does the job and it's from a design bureau that makes high-end controllers.
An MPPT controller will do a much better job getting all available power out of your panel, and solar panels are rated for this. If you aren't using one, derate your panel by about 1/3.
Panels
From there you connect your panels to the charge controller. Make sure you are accounting for voltage-drop from the distance the wires must travel from the panels. I've seen projects essentially fail because a guy tried to carry 12 volts 100 feet on #6 wire. For his large panel, #0000 wouldn't have been excessive.
How much panel? Again ask the off-grid homepower folks, but an example might be to be able to recharge 3 days of usage in one good solar day in the winter. Figure 1/3 of the day gives peak panel power, and must make up for 3 days, so 9x your load, or 9 amps. 108 watts, but if you're not using an MPPT charge controller, more like 160 watts. But don't let that discourage you, you can always add capacity later, or use alternate charging methods on cloudy stretches.
Transfer switches, inverters, subpanels, and all that jazz
That stuff is all for running 120V loads off solar. You can do it, but it implies a rather large and ambitious solar system. There's something inherently stupid about using an expensive inverter to convert 12VDC to 120VAC to run a wall-wart to make 12VDC. Why on earth would you do that?
It is always better to find a way to run your loads on low-voltage DC, rather than provision an inverter to run 'em on AC. If you're trying to run a modem, router, TV, tablet/phone charger, etc. then that is easy.