Make subnet configurable

Replaces #2 by @s0enke, rebased with small mods.

This caught me out and would be quite useful.