Mike; what Bryan said.
I'm not clear either, on what the outside receptacle is for(?)...
To avoid confusion, let's call the female connections 'receptacles' and the male cord ends 'plugs'.
The switch mounted outside the cabinet would be in a single gang box, with a power cord leading off to the power supply, terminated at the far end with a 3 prong male plug.
the interior wire from the switch (the load side) would go to another single gang box, or a short length of appliance cord (2 wire and ground...14/2/1SJ cable) terminated in a female cord end .
The router plugs into that end.
In the outside box, the two black wires go to either side of the switch. The two whites get Marreted together, and the greens get Marretted as well but you also need a short piece of Green wire to the ground screw on the box.