Make openSUSE work with Chromecast, getting to know your firewall zone in Linux.
Tags: linux, opensource, productivity, beginners
Published: 2022-09-18 04:05:37

You might find yourself having a hard time making Chromecast work on your openSUSE or Linux-box in general. Well, the issue lies in your firewall settings. 

In this article, I will focus on **[firewalld](https://firewalld.org/documentation/man-pages/firewall-cmd)**, a zone-type firewall - rules based on zone, that's pre-installed in openSUSE, Fedora, etc. You can skip this article if you're using **[ufw](https://manpages.ubuntu.com/manpages/jammy/en/man8/ufw.8.html)** that's pre-installed in Ubuntu.

Basically, all you need to do is:

```
nmcli connection modify 'YourConnectionName' connection.zone home
```

This setting will change your connection to the _home zone_ that will be more compromised than the default public zone, allowing you to connect with your Chromecast devices. This setting will also persist on reboot, so you only have to do it once. I will explain in detail below.

---

## Do not change your device zone, change a connection zone instead

![Zone on The Road](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g400fi9k0pn4v5f9073d.jpg)

Why changing your device/interface zone is a bad idea? Let's assume that on this interface, a wireless card in your laptop, for example, you might use to connect to your home's wifi hotspot, your school's wifi hotspot, coffee shop's wifi hotspot, etc. Well, you wouldn't trust all those hotspots equally, would you? Yes, that's why changing your device/interface zone is a bad idea. And that's also the reason why the device/interface zone is set to public by default. It's needless to say that changing the default zone, or open a specific port range, would be the worst idea 😂

I recommend you change your most trusted connection zone, your home network, for example, to _home_, so you can use Chromecast on this network, along with many connection types that wouldn't work otherwise.

---

## Knowing your current connection zone, and changing the zone

![A Map](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhngxj32vintz92u5h36.jpg)

It's surprisingly hard to find your connection zone, as the zone is not presented in GNOME Settings (**[issue #1425](https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1425)**), nor YaST Firewall. Google doesn't help much either. Here's how to find your zone before making any change.

1. Finding your _active connection name_ first:
     ```
nmcli connection show --active
     ```
     &nbsp;
     
     This will return something like:
     ```
NAME                UUID                           TYPE  DEVICE 
YourConnectionName  xxxxxxxxxxxxxxxxxxxxxxxxxxxxx  wifi  xxxxxx
     ```
     &nbsp;
     
2. Finding _its zone_:
     ```
nmcli connection show 'YourConnectionName' | grep zone
     ```
     &nbsp;
     
     This will return: 
     ```
connection.zone:                        public
     ``` 
     &nbsp;
     
3. Changing your connection zone to _home_
     ```
nmcli connection modify 'YourConnectionName' connection.zone home
     ```
     &nbsp;
     
4. Checking your connection zone again:
     ```
nmcli connection show 'YourConnectionName' | grep zone
     ```
     &nbsp;
     
     It should return: 
     ```
connection.zone:                        home
     ```

---

After this, you should be able to cast to Chromecast devices on openSUSE or any system with firewalld. It's worth to check whether you have the default allowed services on your home zone in YaST Firewall. You should have `dhcpv6-client`, `mdns`, `samba-client`, and `ssh` services on the allowed list.

I hope this helps.
 
---

**Cover** photo by **[Viktor Forgacs](https://unsplash.com/@sonance?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)** on **[Unsplash](https://unsplash.com/s/photos/chrome?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)**

**Zone on The Road** photo by **[David Clarke](https://unsplash.com/@thethinblackframe?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)** on **[Unsplash](https://unsplash.com/s/photos/zone?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)**

**A Map** photo by **[Hendrik Morkel](https://unsplash.com/@hendrikmorkel?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)** on **[Unsplash](https://unsplash.com/s/photos/find?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)**