Starting from the rigorous excitation equation, the propagation of waves through a 2D waveguide with the periodically corrugated finite-length insert is examined in detail. The corrugation profile is chosen to obey the property that its amplitude is small as compared to the waveguide width, whereas the sharpness of the asperities is arbitrarily large. With the aid of the method of mode separation, which was developed earlier for inhomogeneous-in-bulk waveguide systems [Waves Random Media 10, 395 (2000)], the corrugated segment of the waveguide is shown to serve as the effective scattering barrier whose width is coincident with the length of the insert and the average height is controlled by the sharpness of boundary asperities. Due to this barrier, the mode spectrum of the waveguide can be substantially rarefied and adjusted so as to reduce the number of extended modes to the value arbitrarily less than that in the absence of corrugation (up to zero), without changing considerably the waveguide average width.