Add some validation for externalized service ports.

Filed #2457