My eldest son has his hammock slung under the bunk beds he shares with his younger brother. The hammock is slung diagonally across the bed and attached with climbing slings which are wrapped several times around the uprights and horizontal struts.

Not a setup I'd recommend for an adult or heavier kid but works for my son as he weighs virtually nothing (he'd blow away in a summer breeze).