
The only thing you can do is not allow the dog acess to the window in the front room when you are not there to stop it barking.
Mine do the same (though it is mainly because they love visitors and get excited) as I live on a busy street with a Bus Stop outside, but do have a front garden.
The dogs will bark when people stop by or turn in my drive, people arive to the houses next door, or people stop to chat by the drive.
If they can't see or hear them then they are quiet.
This means if I go out they go in the kitchen with the radio on and all windows and doors have to be closed.
It is perfectly normal for them to guard their territory, same as many dogs will guard the car if people come too close to it.