With the advance of the exploration and development technology, the corrosion problem in oil and natural gas industries has attracted more and more attention due to the appearance of H2S, CO2 and other corrosion medium in the oilfields. 20G steel was used as materials of the gas pipeline in P5 gas field. Corrosion failure of the gathering pipeline of No. 03 well was found in 2009. Therefore, the inhibitor CT2-4 was suggested to be used in the field. The anti-corrosion technology was discussed based on weight loss and electrochemical methods. According to the corrosion environment, the inhibition rate of CT2-4 is higher than 85% when its dosage is more than 125mg/L. The corrosion rate is decreased below 0.076 mm/a. The electrochemical results discover CT2-4 is a mixed-type inhibitor. In order to promote the anti-corrosion efficiency, the pre-film was investigated also. It shows the amount of prefilming and prefilming time are 1250 mg/L and 4h.