Setting curve boundaries for moving objects

How can I set curve boundaries to moving objects?