The cost of replacing cast iron drain pipe depends on the length, size, and type of pipe. The average cost per linear foot is $23 to $75. A backhoe is needed to lift the heavy pieces in and out, and digging and backfill are not included in this price.