  Lyman $\alpha$ observations during an exoplanet transit have proved to be
very useful to study the interaction between the stellar wind and the planetary
atmosphere. They have been extensively used to constrain planetary system
parameters that are not directly observed, such as the planetary mass loss
rate. In this way, Ly $\alpha$ observations can be a powerful tool to infer the
existence of a planetary magnetic field, since it is expected that the latter
will affect the escaping planetary material. To explore the effect that
magnetic fields have on the Ly $\alpha$ absorption of HD 209458b, we run a set
of 3D MHD simulations including dipolar magnetic fields for the planet and the
star. We assume values for the surface magnetic field at the poles of the
planet in the range of [0-5] G, and from 1 to 5 G at the poles of the star. Our
models also include collisional and photo-ionisation, radiative recombination,
and an approximation for the radiation pressure. Our results show that the
magnetic field of the planet and the star change the shape of the Ly $\alpha$
absorption profile, since it controls the extent of the planetary magnetosphere
and the amount of neutral material inside it. The model that best reproduces
the absorption observed in HD 209458b (with canonical values for the stellar
wind parameters) corresponds to a dipole planetary field of <~ 1 gauss at the
poles.
