I actually recently switched to UFW (uncomplicated firewall) for Ubuntu. It's pretty easy to set up once you have some working examples. Allowing only certain ports is a breeze, allowing certain ports for certain IP ranges is a little more difficult.