Enable the user to enforce validity of the gateway IP

Fixes bug 1096532

A new configuration variable is added to enable the user to indicate
if the gateway should be validated on the subnet. For backward
compatibility this is set as False by default.

Change-Id: Ieadd60a945d34703bfee7576aa3b2ff7da3143d4