fixes #2285 - subnet validation - length of addresses, strip whitespace and fix common typos
(cherry picked from commit 31aa5db511a6decf800e68a2b6f6eb3dbf0ae29c)