The vibration of buried pipeline is influenced by inner fluid and outer constrained soil. Euler-Bernoulli beam is analyzed in the vibration model of buried pipeline, using the Hamilton principle. In addition, the differential equations of transverse vibration of buried pipeline deduced by the mechanical model are transformed into basic form of dynamics equations, considering earthquake excitation as random wave. Using the method of the elasticity time-travel analysis to programming, the pipe element, the soil parameter and the earthquake dynamic parameter are analyzed in the Matlab software. With soil from soft to hard, the response of piping displacement becomes smaller and smaller. In the same soil, the earthquake damage rate of the piping becomes increaser and increaser with earthquake intensity increasing.