Abstract. Magnetic clouds (MCs) are huge interplanetary structures which originate from the Sun and have a paramount importance in driving magnetospheric storms. Before reaching the magnetosphere, MCs interact with the Earth's bow shock. This may alter their structure and therefore modify their expected geoeffectivity. We develop a simple 3-D model of the magnetosheath adapted to MCs conditions. This model is the first to describe the interaction of MCs with the bow shock and their propagation inside the magnetosheath. We find that when the MC encounters the Earth centrally and with its axis perpendicular to the Sun-Earth line, the MC's magnetic structure remains mostly unchanged from the solar wind to the magnetosheath. In this case, the entire dayside magnetosheath is located downstream of a quasi-perpendicular bow shock. When the MC is encountered far from its centre, or when its axis has a large tilt towards the ecliptic plane, the MC's structure downstream of the bow shock differs significantly from that upstream. Moreover, the MC's structure also differs from one region of the magnetosheath to another and these differences vary with time and space as the MC passes by. In these cases, the bow shock configuration is mainly quasiparallel. Strong magnetic field asymmetries arise in the magnetosheath; the sign of the magnetic field north-south component may change from the solar wind to some parts of the magnetosheath. We stress the importance of the B x component. We estimate the regions where the magnetosheath and magnetospheric magnetic fields are anti-parallel at the magnetopause (i.e. favourable to reconnection). We find that the location of anti-parallel fields varies with time as the MCs move past Earth's environment, and that they may be situated near the subsolar region even for an initially northward magnetic field upstream of the bow shock. Our results point out the major role played by the bow shock configuration in modifying or keeping the structure of the MCs unchanged. Note that this model is not restricted to MCs, it can be used to describe the magnetosheath magnetic field under an arbitrary slowly varying interplanetary magnetic field.