You can follow the steps in my Swarm Agent Troubleshooting guide to check which ports are being used.