Validate ip addresses