While working in a very complex environment (lots of segregated and isolated VLANs, firewalls, 8 non trusted domains, NAT between domain etc.) I discovered that the communication coming FROM the agent to the Gateway or Management servers is not originating from 5723. The communication from the Gateway and Management Server TO the agent is originating from port 5723. It appears the agent is randomly grabbing a port to communicate from.
What made us start looking at this was agent discovery was failing (In the end discovery was failing for a different reason). We could install the agent manually and it would report into SCOM, send alerts, events etc. We were concerned that there were some port issues that would cause trouble down the road so we began running telnet tests on both sides of the connection. The telnet test would fail from the GW to the agent on 5723, but would succeed from the agent to the GW. We then ran netstat -a cmd and could see that the agent is randomly picking ports to communicate on looking to the mgt server port 5723.
So be fore warned in complex environments where you need to have firewall ports opened and you are running in to problems you can try to use the telnet test, but make sure you also run a netstat test to see what port your agent is listening on.
Read the complete post at http://david-stclair.spaces.live.com/Blog/cns!112A71B19678F08D!166.entry