Updated: Sep 16
The clove hitch is a great knot for tying to round cylindrical items. It will hold tightly and not slide when tied correctly.
Start the knot by bringing the end of the rope over the pipe. Then take the rope around the back of the pipe and pick a side of the rope to go next to. Then you are going to add one more wrap around behind and come through the hole that you have made. It is important to keep that hole open as you come around the pipe so that you have a good location for the end of the rope to come through. After those two wraps around the pipe and going under the second wrap you can finish the knot by tightening the whole thing up. It should sit nicely without any twists when you are finished.
A clove hitch can slip and if you are doing anything really requiring security then it should be backed up with some half hitches.