Run from a terminal session as root: (you can also use sudo)
[root@server ~]# iptables -I or -A INPUT
-I is to Insert
-A is to Append
# Accept tcp packets on destination port 20031 (netvault)
iptables -A INPUT -p tcp --dport 20031 -j ACCEPT
Here we append (-A) a rule to the INPUT chain for packets matching the tcp protocol (-p tcp) and entering our machine on destination port 20031 (--dport 20031).
Note: In order to use matches such as destination or source ports (--dport or --sport), you must first specify the protocol (tcp, udp, icmp, all).
We can also extend the above to include a port range, for example, allowing all tcp packets on the range 20031 to 20131:
# Accept tcp packets on destination ports 20031-20131
iptables -A INPUT -p tcp --dport 20031:20131 -j ACCEPT
#You can also add the netvault ip address as an allowed ip address to the firewall by typing the following:
iptables -I INPUT -p tcp -s <netvault ip address> -j ACCEPT
iptables -I INPUT -p udp -s <netvault ip address> -j ACCEPT
iptables -I OUTPUT -p tcp -d <netvault ip address> -j ACCEPT
iptables -I OUTPUT -p udp -d <netvault ip address> -j ACCEPT
*Save these firewall rules:
[root@server ~] # /sbin/service iptables save