The invention relates to a metal pipeline or pipe fitting surface abrasion-resisting and anticorrosion protection technology, in particular to a pipeline or pipe fitting provided with a silicon carbide ceramic abrasion-resisting and corrosion-resisting liner and a preparation method thereof. The pipeline or the pipe fitting is composed of the abrasion-resisting and corrosion-resisting liner and a metal layer from inside to outside. The abrasion-resisting and corrosion-resisting liner is composed of a surface layer and a compounded layer. The surface layer is a compact ceramic layer. The compounded layer is a foam ceramic layer and directly grows on the back face of the compact ceramic layer. The preparation process comprises the following steps of preparation of mixed powder, preparation of slurry, preparation of a foam precursor in a tape casting mode, bonding, thermocuring forming in a mould, machining, bonding forming, pyrolysis, sintering, and compounding to obtain afinished product. According to the ceramic liner abrasion-resisting and corrosion-resisting pipeline or pipe fitting prepared through the preparation method, the abrasion-resisting service life can be five to ten times that of a rubber-lined abrasion-resisting layer, the resistance to acid and alkaline corrosion and high-temperature impact is excellent, the replacement period of the pipeline or pipe fitting can be effectively prolonged, accordinglythe operation cost of enterprises is lowered, and emission of particulate pollutants is reduced.