To add to what voodoolamb posted -
If your goal is to have a great (safe) time hiking and camping, and your puppy is only 5 months old, you're at a nearly perfect age to teach and reinforce the behaviors that you DO want.
Pick a noise - a specific whistle, a sharp "PSSSSSt", something that is not your formal obedience "Come" command, and a noise you're not using for something else. Load that noise with food or produce a toy, whatever motivates your dog. Make that noise randomly when your puppy is sniffing around the yard, or looking out the window, or not actively engaged with you. If you load it and reinforce it consistently, that noise will become your trail command for "Hey you, you're too far ahead! Hey you, hurry up! Hey you, look at me!" Done well, this won't screw up, confuse, or muddy your obedience commands for sport or training.
Skip breakfast, and take your dog on breakfast picnics to areas with squirrels and birds and whatever else you have access to. In all weather. If the puppy can't ignore the critters and smells to eat its meal, too bad - pack the food up and keep walking.
I prep puppies for hiking off leash on a flat collar with a long line. Horse lead ropes work great - tie a knot in the end. Let the puppy drag the rope. If it gets too far ahead, step on the rope (the knot will act as an emergency break). Puppy gets head-checked. On the other hand, when the puppy is ambling along at a nice close distance, there is no pressure on the collar at all, no sense of human control on the other end of the leash. I don't use a heel command for hiking - all I care about is that the dog is aware of my location and stays in mental contact with me.
After you clearly train your puppy and reinforce the desirable behaviors you DO want, proofing those behaviors can follow.
If you jump straight into blasting a dog for romping off, before it understands with clarity what is supposed to be going on, you can end up with weird "hot lava" behavior where the dog is freaked out unless glued to your hip. I've seen it.
5 months is an awesome age to raise a hiking buddy... hope you have lots of good times.