My environment is same as yours db2 client ===> Db2 gateway ====>
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.
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.