Using Navmesh for Player navigation

Currently I am using the built in character controller prefab to navigate in a scene. However, I would like to restrict player movement to the navmesh I create with a terrain (with obstacles). I have no problem creating the navmesh, however, I do not know how to set the character controller to stop navigating using character motor component and start navigating utilizing the created navmesh.

Do I have to code it or is there a component already available (or a different prefab) I can get started with?

Just to clarify, I want to restrict Player movement not AI movement to the navmesh.

Hi I found this: Unity3D NavMeshAgent for Player Control | St Pierre's Vault