A variable optical attenuator is provided at an input terminal of a rare-earth doped optical fiber. The variable optical attenuator attenuates a multiwavelength light under the control of an AGBC circuit. The rare-earth doped optical fiber, which is excited by an excitation light generated by a light source, amplifies the multiwavelength light output from the variable optical attenuator. An ALC circuit controls the light source in such a way that an average optical level of the multiwavelength light output from the rare-earth doped optical fiber is kept constant. The wavelength division multiplexing coupler selects two optical signals having different wavelengths from the multiwavelength light amplified by the rare-earth doped optical fiber. The AGBC circuit controls the attenuation of the variable optical attenuator in such a way that the above described two optical signal levels match each other.