Sunday, April 19, 2020

Chromcast chromium Linux not connecting

Just a short post on problems connecting Chromium to a Chromcast device

Much confusion on this problem, people go into great detail on obvious answers with setting up Chromcast but of course this is a bit more detailed then simple setup problem. The first problem is to see that chromium supports casting nativity no need for extensions for apps etc. Go into settings and you will see a cast label, select the label and something should popup like cast tab ? If your Chromcast device pops up your are all set, if not read on. Chromcast is not firewalls friendly , IE once found a udp flow from Chromcast comes to your machine/IP that is NOT related . So in order to connect to your Chromcast device you must open your machine FW a bit. Since Chromcast works best if you are on the same wireless device you can put up a rule that just's allows the Chromcast device IP in your INPUT rules: "iptables -I INPUT 7 -s Chromcast-IP -j ACCEPT -m comment --comment "chromcast cast device" , where Chromcast-IP is the IP of the device. I found a much more complicated set of rules like this:
export CHROMECAST_IP=10.1.2.3 # Adjust to the Chromecast IP in your local network
iptables -A INPUT -s ${CHROMECAST_IP}/32 -p udp -m multiport --sports 32768:61000 -m multiport --dports 32768:61000 -m comment --comment "Allow Chromecast UDP data (inbound)" -j ACCEPT
iptables -A OUTPUT -d ${CHROMECAST_IP}/32 -p udp -m multiport --sports 32768:61000 -m multiport --dports 32768:61000 -m comment --comment "Allow Chromecast UDP data (outbound)" -j ACCEPT
iptables -A OUTPUT -d ${CHROMECAST_IP}/32 -p tcp -m multiport --dports 8008:8009 -m comment --comment "Allow Chromecast TCP data (outbound)" -j ACCEPT
iptables -A OUTPUT -d 239.255.255.250/32 -p udp --dport 1900 -m comment --comment "Allow Chromecast SSDP" -j ACCEPT

That said my simple rule is a bit simpler and assumes you all ready have rules that allows outbound connection like this: INPUT/OUTPUT ctstate RELATED,ESTABLISHED , that allows outbound connections to flow . I think the complicated above should work but is a bit complicated so I didn't try it . Once I had the one rule for the Chromcast IP in INPUT everthing worked from Chromium without issues . Most problems are simple and most solutions are also simple why get complicated .

Some wastland posts

Some wastland posts