The paper deals with diffusion of a particle in a tube that consists of alternating wide and narrow sections. At sufficiently long times the particle motion can be coarse-grained and described as effective free-diffusion along the tube axis. In the coarse-grained description all the details of the tube geometry are packed into the effective diffusion coefficient of the particle. We derive a formula for the effective diffusion coefficient, which shows how it depends on the geometric parameters of the tube. To test the accuracy of this formula we compare its predictions with the values of the effective diffusion coefficient found in Brownian dynamics simulations. The comparison shows that the formula is applicable at arbitrary values of the length and radius of the narrow sections on condition that the radius of the wide sections does not exceed their length.