Though in the past toilet waste pipes (or sewer lines) were made of cast iron or even lead, today sewer pipes are usually made of either black ABS (Acrylonitrile Butadiene Styrene) plastic, or white PVC plastic. The sewer line starts at the toilet flange--a pipe with a flat lip surrounding one end--which is attached to a 90-degree elbow joint. This connects to the sewer pipe, wihch runs via a connecting coupling into the main sewer line.
Mark on the toilet floor the location where the toilet flange hole needs to be cut out. Refer to the toilet manual regarding the required direction from the back wall, and side wall -- if it is in close proximity. Place the flange on the mark, and circle with a pencil on the floor around the base.
Drill out the circle with a 1.2 cm (1/2 inch) wood drill bit, and push the flange into the hole so that the lip rests on the bathroom floor.
Apply ABS glue to the inside bottom end of the flange. Glue also the outside male end of the 90-degree elbow joint. Push the elbow joint up into the flange, and hold for 30 seconds.
Glue the inside female end of the elbow joint, and the end of a new piece of sewer pipe. Push the pipe into the elbow joint, and hold for 30 seconds. Glue couplings and new pipe as needed, until the new toilet sewer pipe reaches the main sewer line.
Mark the main sewer pipe where the new toilet sewer pipe will connect into it -- use a felt tip pen. Using a hacksaw, cut through the pipe at the mark. Remove any burrs with a tradesman's knife, and wipe both sides of the cut with a damp rag.
Glue both sides of the cut, and the inside of the connecting coupling. Push the coupling between the two cuts. Make sure the coupling's spout is located so that it reaches the new toilet sewer pipe, and hold in place for 30 seconds.
Glue the inside of the coupling's spout, and the end of the new toilet sewer pipe. Push the pipe into the spout, and hold for 30 seconds.
Attach the flange lip to the bathroom floor with 4 cm (1 5/8 inch) galvanised screws. The toilet can now be installed over the flange.
The connecting coupling has a diameter the same as the existing main sewer line, and its spout on the side will have the same diameter as the new toilet sewer pipe. If you are using PVC sewer pipe, first prime all joints with PVC primer before using PVC glue.