Regis' Blog

L'informatique, L'amour, Les vaches

Add firewalld rules for Samba on Fedora 23
November 10, 2015
in Firewall Samba |
Share this post
| |
Add firewalld rules for Samba on Fedora 23

Fedora use Firewalld for the firewall, but I don’t know why, I couldn’t permanently open the the samba service on my network. I just want to share files on my network.

Add the entry

I tried  firewall-config but on each reboot the firewall configuration was restored to the default. After few attempts, I found the file in /etc/firewalld/zones/FedoraWorkstation.xml and then I add <service name="samba" /> to this file because I saw this in the GUI program:

entry in firewall-config

The configuration file

<?xml version="1.0" encoding="utf-8"?>  
   <short>Fedora Workstation</short>
       Unsolicited incoming network packets are rejected from port 1 to 1024, except
       for select network services. Incoming packets that are related to outgoing
       network connections are accepted. Outgoing network connections are allowed.

   <service name="dhcpv6-client"/>
   <service name="mdns"/>
   <service name="samba-client"/>
   <service name="samba" />
   <service name="ssh"/>
   <port protocol="udp" port="1025-65535"/>
   <port protocol="tcp" port="1025-65535"/> 

Et voilà ! It works. Now at boot time, the firewalld program add a rule for Samba.