Sand off the old, flaking paint from the posts with fine-grit sandpaper. The paint that is still sticking well does not need to be removed; however, sand over it lightly to roughen the surface and allow the new paint to stick. Wear a respiratory mask when sanding off the paint since toxic dust may be released.
Remove any visible rust from the posts with a wire brush. Scrub vigorously to effectively remove all of the rust.
Clean the posts with a rag dampened with mineral spirits to remove all traces of sanding and paint dust as well as dirt and other grime that may be on the iron. Dry the posts thoroughly.
Spray a light coating of an alkyd rust-inhibiting primer onto the posts. Shake the can of primer well, and hold it about six inches from the surface. Press down on the trigger and spray it evenly over the posts. Allow the first coat of primer to dry according to the manufacturer’s recommendations, and then apply a second coat. Allow the final coat to dry completely.
Spray alkyd enamel paint to the railings in the same manner in which you applied the primer. Apply at least two coats; additional coats may be applied to achieve the appearance you desire. Allow each coat to dry thoroughly before applying the next.