I hope you are using a linux machine and iptables firewall, so I am adding my points here. If you could be more specific on which Operating system, that would help all the geeks here to help you.
First of all, you are not going to open all the ports since unless you need something going through a particular port, you will not keep that port open as a security measure.
The following command will help whitelisting a global range of IPs that connect through your machine's eth0 interface.
=====================
iptables -A INPUT -i eth0 -p tcp -s 192.168.100.0/24 --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
=====================
The below command will open many ports for an interface, so you can combine both the rules to make one.
=====================
iptables -A INPUT -i eth0 -p tcp -m multiport --dports 22,80,443 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp -m multiport --sports 22,80,443 -m state --state ESTABLISHED -j ACCEPT
=====================
FYI :
http://www.thegeekstuff.com/2011/06/iptables-rules-examples/