[Samba] Problem with samba and firewalld on Fedora22

Jakov Sosic jsosic at gmail.com
Fri Sep 25 23:19:46 UTC 2015


On 09/24/2015 02:37 PM, Frank Millman wrote:
> Hi all
>
> I don't know if this is a samba issue or a firewalld issue, but I have had
> no response from a couple of forums where I have asked, so I thought I
> would
> post the problem here.
>
> For testing, I have Fedora22, Fedora18, and Windows7.
>
> Fedora22 is running Samba 4.2.2, Fedora18 is running Samba 4.0.11.
>
> Samba has been added to firewalld as an allowed service on both Fedora's.
>
> If Fedora18 boots up with firewalld enabled, both Fedora22 and Windows7 can
> connect using samba.
>
> If Fedora22 boots up with firewalld enabled, only Fedora18 can connect.
> Windows7 cannot see the server at all, If it boots up with firewalld
> disabled, both can connect.
>
> Booting up with firewalld enabled and then stopping or restarting firewalld
> makes no difference. However, booting up with firewalld enabled and then
> restarting nmb makes all the difference - after a few seconds delay,
> Windows7 can connect.
>
> It seems that when Fedora22 starts with firewalld enabled, samba starts
> with
> the server name of LOCALHOST. After restarting nmb and waiting a few
> seconds, it changes to FEDORA22 (the name specified in /etc/hosts). Once it
> has changed, Windows7 can connect with no problem.
>
> There are two ways of demonstrating this. Firstly, when samba starts up, it
> creates the file /var/lib/samba/browse.dat, and you can see the server name
> there. Secondly, if I run 'nmap -T4 -A -v' against Fedora22, under the
> section 'Host script results', it shows
> 'NetBIOS name: LOCALHOST'. After restarting nmb, or after rebooting with
> firewalld disabled, it shows 'NetBIOS name: FEDORA22'.
>
> Fedora18 does not show any of these problems. With firewalld enabled, samba
> starts up with the server name FEDORA18, and Windows7 can connect straight
> away.
>
> My guess is that this is a timing issue - samba is starting up before
> firewalld has opened the necessary ports.
>
> Any advice on how to fix it will be much appreciated.



1. Did you try to set:

netbios name = FEDORA22

   in your /etc/samba/smb.conf?

2. You can always modify /usr/lib/systemd/system/nmb.service and specify 
it should start after firewalld:

After=firewalld.service

(or something similar - I don't Fedora22 at hand currently - ah, Lennart 
Lennart you *ucked up Linux with your systemd bull*it)



More information about the samba mailing list