When it is necessary to exclude traffic from any portion of a highway, the department may close that portion of the highway by posting in a conspicuous manner, at each end of the portion closed, suitable signs warning the public that the road is closed under authority of law, and by erecting suitable obstructions.