UFW Firewall Preventing GNOME Display Screensharing on Fedora Laptop
If you're running UFW (Uncomplicated Firewall) on your Fedora laptop and you've encountered an issue with GNOME display screensharing, you may have thought that adding a simple UFW rule would fix the problem. However, it turns out that it's not that straightforward.
Understanding the Issue
By default, UFW is configured to block all incoming connections to your laptop, including those required for GNOME display screensharing. Even if you add a rule to allow incoming connections on the necessary port, it still may not work.
The reason for this is that GNOME display screensharing requires bidirectional communication, meaning that both incoming and outgoing connections are needed. Allowing incoming connections alone is not enough. Additionally, GNOME uses a dynamic range of ports for screensharing, so allowing a single port or even a range of ports may not be enough either.
Finding the Solution
To solve this issue, you need to allow outgoing connections as well as incoming connections on all ports. This can be accomplished using the following command:
sudo ufw default allow outgoing
This command allows all outgoing connections. Keep in mind that this may not be ideal for security reasons, so you may want to revert this setting after you're done using GNOME display screensharing.
Verifying the Solution
To verify that the issue is resolved, you can check the status of UFW using the following command:
sudo ufw status numbered
You should see that both incoming and outgoing connections are allowed on all ports:
Status: active
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/udp ALLOW IN Anywhere
80/tcp ALLOW IN Anywhere
80/udp ALLOW IN Anywhere
443/tcp ALLOW IN Anywhere
443/udp ALLOW IN Anywhere
22 ALLOW OUT Anywhere
22 (v6) ALLOW OUT Anywhere (v6)
22/tcp (v6) ALLOW OUT Anywhere (v6)
22/udp (v6) ALLOW OUT Anywhere (v6)
80 (v6) ALLOW OUT Anywhere (v6)
443 (v6) ALLOW OUT Anywhere (v6)
- UFW blocks incoming connections to your Fedora laptop by default
- Allowing incoming connections alone is not enough for GNOME display screensharing
- To allow GNOME display screensharing, you need to allow both incoming and outgoing connections on all ports
- You can allow outgoing connections using the command:
sudo ufw default allow outgoing - To verify the solution, you can check the status of UFW using the command:
sudo ufw status numbered
References
-
Book: "Uncomplicated Firewall" by James Clawson
-
Article: "How to: Allow Gnome Screensharing Through Firewall (UFW)" by Jose Cifuentes
https://www.linode.com/community/questions/162679/how-to-allow-gnome-screensharing-through-firewall-ufw -
Online resource: UFW documentation
https://wiki.ubuntu.com/UncomplicatedFirewall