Redhat 9 should have a fancy little wizard to set that up for you

Will be in the Kmenu or whatever the hell you call that foot, under system if i remember correctly. Just tell it the ports you want open, it will block everything else by default.
If that isnt working for you let me know and I can paste you an iptables script that will just block everything, and open up a few ports for you if you want.