The standard linux firewall is iptables and comes with most distros. I think it may also be used by Solaris but I'm not sure on this. To configure the firewall on a linux box as per your needs, first of all be root. Then:
This will list the current firewall ruleset. Find the name of the chain that's got the input rules in it - as you're using RH9 I expect it to be something like RH-Firewall-1-INPUT - that's what I'll use in the code below, change it if it's wrong.
Enter the following commands, still as root:
Code:
iptables -A RH-Firewall-1-INPUT -p udp -m udp --dport 177 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 512 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 513 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 514 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p tcp -m tcp --dport 23 -j ACCEPT
When you've done that, the rules are active and you can test them. Once you're happy that they're doing what you want, commit them to disk so they load next time you boot - otherwise you'll have to reload them. Still as root:
Code:
service iptables save