Get yourself some curtain rod brackets. They come in all sizes.
Use an iron bar.
I am wondering what is the length of the rod you need? I have used support braces on each end of the rod and added a middle brace if the length is longer.
Most use 1x 3" lumber on sides of the closet, then affix the rod using the round metal fixures..... if it is a long run of rod, you can buy a metal bracket at the hardware store to fix to the back of the closet that holds the rod.
https://www.truevalue.com/wardrobe-door-pole-socket-plastic i prefer the brass ones
this fastens at the back of the closet, and I got the kind to put a shelf on top.... https://www.truevalue.com/white-closet-rod-shelf-bracket cause my rod was 6'