The paper proposes a numerical method for solving the problem of the gas-dynamic state of a main gas pipeline linear section, which is characterized by a path change in the diameter and leveling height of the pipeline axis. The quasi-one-dimensional equations of gas pipeline transport are derived with account for the local and convective components of the inertia force, the quadratic law of resistance and the force of gravity at a variable cross-sectional area of the pipeline. At the inlet to the section, a time change in hydrostatic pressure is set, and at the outlet from the section a mass rate of gas flow is set. The initial distribution of gas-dynamic indices was taken for a stationary mode of operation. The equations were transformed to the equations of direct and reverse traveling waves presented in dimensionless variables, and approximated by an implicit scheme, taking into account the direction of excitation propagation. The iterative processes were formed by virtue of the nonlinearity of equations and boundary conditions, A calculation program was developed that allowed studying the process dynamics depending on the time change in the inlet pressure and the outlet mass flow rate under a path change in the diameter and leveling height of the pipeline axis. The results of separate calculations on transient processes were presented, when, at the section outlet the mass flow rate increases abruptly, and the pipe diameter has a local increase according to a sinusoidal law.