My environment is same as yours db2 client ===> Db2 gateway ====>
DB2 MF.
All are solaris.I have seen this sort of error all the time, because of firewall /MF not listening.
The steps that I generally take are.
1. Ask the person that the MF is up, especially the DDF.
2. Try to connect from the gateway first, if it is succeed , then OK otherwise I will check whether any buffer has been communicated.
using db2dart.
3. If gateway able to connect then check the DB2COMM registry variable to set up the commmunication manager and start it and the services file.
4. At the the db2 client use
telnet <hostname>/<IP_address> <port_no_at_gateway>
regards
Mujeeeb