How should I tie a bike to a hitch mounted bike rack to keep it from swaying into the bumper of my vehicle?
Several possibilities,

Pool noodles - cut one vertically and mash it over the upright post of the hitch.  Retain in place with zip ties.

Bungee cords with hooks on the ends can be used to pull the bike frame toward the upright.  Also can wrap around top tube and horizontal of frame

Old inner tubes can be used in either role - they take a knot quite well.


There's nothing stopping you doing more than one thing to secure your bike.