Radio over fiber (RoF) systems use a large number of base stations (BSs) and a number of central stations (CSs), which are interlinked together to form the network. RoF systems use multiple wavelengths for communication between CSs or between CSs and BSs to facilitate the huge amount of data traffic due to the multiple services for a large number of users. When erbium-doped fiber amplifiers (EDFAs) are used as amplifiers in such wavelength-division multiplexed systems, the nonuniform gain spectrum of EDFAs causes instability to some of the channels while providing faithful amplification to other channels. To avoid this inconsistency, the gain spectrum of the amplifier needs to be uniform along the whole usable range of wavelengths. A gain contouring technique is proposed to provide uniform gain to all channels irrespective of wavelength. Optical add/drop multiplexers (OADMs) and different lengths of erbium-doped fibers are used to create such a gain contouring mechanism in the optical domain itself. The effect of a cascade of nonuniform gain amplifiers is studied, and the proposed system mitigates the adverse effects caused due to nonuniform gain-induced channel instability effectively.