You are fortunate to have a Rottweiler! Some Rottweilers don't bark until their fully mature and even then only when necessary. Most seem to have a calm wait-and-see attitude about strangers. But if this is not your situation, there are still things you can do to control his barking. The first step is to try and determine why he is barking. Look around at his environment during barking and try to determine the cause.
The Lonely or Bored Rottweiler
Is your dog lonely or bored? Try spending more time with him. Make more time for activities and exercise. Take him places and socialize him whenever possible. This is one of the easiest causes of barking to correct.
The Protective Rottweiler
Is your dog simply trying to protect you? If so, how long should he bark? Usually a loud and startling "Stop" will get his attention followed by a praise and reward for being quite. Consistent and repetitive commands along with reward training should help.
The Fear Barking Rottweiler
Is your dog barking when on walks at everyone oncoming stranger after hiding behind you? Try and determine what is causing the fear. Try to expose him to the situation as much as possible in a positive, repetitive and desensitizing manner. As the stranger comes closer, try giving your dog a treat in hopes he will forget about the stranger and concentrate on his reward. You can also try to get him to sit and focus on his reward for doing so. Do this as often as possible until your dog learns to stop barking at everyone stranger that walks by.
The Responding Rottweiler
Is your dog responding to your neighborhood dogs? Try clapping your hands sharply while shouting "Stop". Try and direct his attention to a "Sit" or "Down" command. Praise him and give him a reward once he quiets down. Your Rottie must learn this form of behavior is not acceptable.
If you cannot determine the reason for your dogs barking or your techniques are not working, consider hiring a reputable trainer to help.