Please refer to the installation guide for installing the Gateway. It will show you the firewall rules needed to make this communication happen.
In a nutshell, you only need OUTBOUND ports 9100, 9101 from your MFT server to your GATEWAY server open.
Make sure you have nothing utilizing ports 21, 22, 443 and 990 on your GATEWAY server
If you are using the same ports on your MFT server, make sure they are not being used by another program.
Then, under the Gateway Configuration, just map the GAG:IP/Port to the MFT:IP/Port
Also, do not forget to make sure your Gateway License is installed properly on your Gateway server.