I have unable to make the M2 chromecast from a remote location with either the iPad or Android app with my Xfinity supplied TC8305C gateway (combined cable modem and wi-fi router). Chromecasting works fine inside my home. I did all the suggested things including rebooting the gateway, setting up port forwarding, setting the firewall function to minimum security, etc. Funny thing was using the tablet applications from a remote location worked great, it was only the Chomecasting that failed. Slingbox support was able to reproduce the same problem, and verified that the required TCP ports were open.
I was able to get things working by putting the Xfinity gateway in bridge mode - effectively disabling the router function and using the gateway as just a cable modem, and dropping in my old Linksys E2000 running the DD-WRT firmware. It worked first time, the only thing I had to do was enable UpNP.