Hello and welcome to LQ!
Please consult to reading the documentation of iptables, using "man iptables" and possibly searching online, especially before you go posting threads. We are here to assist you, not do everything for you. That being said, I will point you in the right direction and give you an example, but next time, please search before you post threads.
Code:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 631 -j ACCEPT
I have taken this segment from my custom iptables configuration. Pretty much what this does is open port 631 for tcp type packets, and accepts the packets when they are new connections coming in. You would need to configure this to open the port on your system. Good luck with learning and searching.
Cheers,
Josh