SAP NW 7.4 default switched on the ACL (access control list) in gateway service, so only local accesses are permitted. RFC destinations such as SLD_UC of ECC or other application systems are all report error connecting.
Turn off the gw/acl_mode in profile, or mainteninance the gw/acl_file, adding external application servers in the list.
In dual-stack PI, change the parameters in RZ11.
But in Java single stack PI-AEX or PO, manually change the profile adding gw/acl_mode = 0 in profile.
Profile is /usr/sap//profile/SCS