Hard type-II hollow superconductors are well suited for low frequency magnetic shielding. The properties and performances of superconducting magnetic shields subjected to homogeneous magnetic fields have been extensively discussed in the literature. In the present work, we investigate the magnetic shielding and the penetration of magnetic flux in a bulk high temperature superconducting tube subjected to the inhomogeneous fringe field of a solenoidal coil. Thanks to a bespoke microdisplacement measurement system, we measure the magnetic field distribution around the tube. We develop a full 3D finite element model based on an H formulation to understand the flux penetration mechanisms and predict the shape of the current loops. Using constitutive law parameters obtained from previous independent experiments, our model is found to be in excellent agreement with the measurements. We discuss how to assess the degree of inhomogeneity of the magnetic field and show that, in our case study, the field can be treated as the magnetic field of an equivalent magnetic dipole. We also show that some features of the flux penetration in inhomogeneous field can be also observed when the tube is subjected to an oblique homogeneous magnetic field, which offers a better understanding of the shielding current density distribution inside the shield. Finally, we discuss the magnetic field concentration occurring around the shield for different magnetic field configurations. In particular, we show that the extremities of the tube on the side not facing the magnetic field source experience the highest flux concentration.