public static bool IsLocal( [NotNull] this IPAddress addr ) { if( addr == null ) throw new ArgumentNullException( "addr" ); byte[] bytes = addr.GetAddressBytes(); return ( bytes[0] == 192 && bytes[1] == 168 ) || ( bytes[0] == 10 ) || ( bytes[0] == 127 ); }