Can't access Openfire with Spark over VPN (iptables?)

Hi,

I’ve installed an Openfire server on CentOS and every workstation in the LAN is able to connect to the server. But not the ones accessing trough VPN. VPN is gateway to gateway. When trying to connect with spark it show the error “Can’t connect to the server: invalid name or server not availible”. If I stop iptables service it works just fine, but don’t want to leave it stopped. I’ve only opened input port 5222 in CentOS. I guess maybe it’s necessary to open some other ports?

Thanks in advance.