Our pup (about 2yo) is a work in progress... she's extremely territorial, quite the bad ass watch dog in her own mind. lol. We've settled into an agreement, she can bark once or twice at something that startles her (knock at the door, bird, deer, someone walking by, another dog, etc). Then we say 'enough' and she knows we've seen the threat and have the situation under control. Her work is then done in her mind, she has saved us from imminent danger again.
But stopping her from barking at all? Not gonna happen with this dog. Just too strong of a startle reflex.
Anyway, when we're camping I like to walk her around and say hi to the neighbors, let her meet the kids and dogs nearby, and tell folks to feel free to let me know if there's any issue with her. I find the shorter the leash, the better behaved she is. In a busy campground we can walk around all day long with her in a nice tight 'heel' position with no barking. If I give her even 4' of leash? She's now got to be on guard and is going to bark at stuff.
Anyway, she is the toughest dog we've ever had. First barker I've ever had. It's embarrassing sometimes, but she's a good dog and loves camping.