A spring-mass model was presented for numerical analysis of the response of a tunnel under the Huangpu River to actual earthquakes. In this model the soil is divided into many strips and each strip is simplified to a mass-spring system. The tunnel is treated as several beams connected by linear springs in longitudinal and lateral directions. The tunnel is connected with the soil also by linear springs in the same two directions. So the total tunnel-soil system is simplified to a rigid multibody system. The vibration response of this system during earthquake can be obtained by a computer program DAMB. From the numerical results it is recommended that every segment of the tunnel should be in the same length in order to reduce the no nuniform displacement and stress between the tunnel segments.