Freeze only y rotation in Rigidbody.

I want to freeze an rigidbody object’s Y rotation.
Then I checked it in Google and found “Rigidbody.FreezeRotation” but all rotations are freezed in Rigidbody.FreezeRotation.

How can I freeze only Y rotation?

You can simply do this in the inspector like in this photo:
[30107-freze+rotation.png|30107]