it depends on how thick it is like if it is a 1 inch pipe with 3/16in. wall then you could drill through it, then put a u-bolt through it. then drill through the wood (which needs to be strong because metal weighs a lot). then bolt through and tighten it until it digs into the wood or you cant tighten it any more
good luck let me know if it works!!