Transport of a gas of two-dimensional electrons through magnetic barriers of different shapes is investigated in the diffusive limit for the two-terminal and the Hall bar configuration. In the two-terminal configuration magnetic barriers lead to a non-local Hall resistance and the addition of the resistance of magnetic barriers in series depends on the relative direction of the magnetic field in the barriers. For the Hall bar configuration with a circular magnetic barrier in the middle, we found that only in the small magnetic field region the Hall resistance is determined by the average magnetic field in the Hall cross.