IIF files have been deprecated by Intuit for about 10 years now. You should not be using them. There are well known issues with IIF files that result in corrupted QuickBooks company files, incorrect balances on accounts in QuickBooks, etc.
Further, you do not need to open any firewall ports to integrate with QuickBooks. There is absolutely no reason to do this.
Neither of the two recommended ways of integrating with QuickBooks (the Web Connector for non-SaaS applications, and Intuit Anywhere/Intuit Partner Platform for SaaS apps) requires opening firewall ports.
The Web Connector uses a poll-over-HTTPS method of communication with outgoing requests initiated from the QuickBooks machine, while Intuit Anywhere/Intuit Partner Platform uses a proprietary communication stream, again with outgoing requests initiated from the QuicKBooks machine. Neither requires any opening of firewall ports since the requests are initiated from the QuickBooks machine, not directly from your app.