The paper analyzes the dynamic response of an underground main pipe under the action of a longitudinal wave propagating in soil along the pipe. The article assumes that the elastic pipe is of a finite length, and a linear viscoelastic model of the “pipe-soil” system interaction is considered. The problem is solved numerically using the explicit scheme of the finite difference method. A longitudinal wave in the soil is taken as a traveling sine wave. The article presents a comparative analysis of the results for certain values of elastic and viscous interaction coefficients, propagation velocity, and pulse duration. Under elastic interaction of the “pipe-soil” system, the reflection of the wave propagating in the underground pipeline at the boundaries of the pipeline coincides with the propagating wave in soil, leading to an increase in the maximum deformation of the underground pipeline, the value of which can double. The viscosity coefficient of interaction at the “pipe-soil” system contact leads to attenuation of the wavefront in the underground pipeline. For soils with values of viscous interaction coefficient of more than 100 kN·s/m2, this may lead to complete attenuation of the bursts at the wavefront in the pipeline. The choice of the step ratio in coordinate and time equal to the wave propagation velocity in the pipeline allows for obtaining results that coincide with the exact solution.