[Samba] Problem with samba and firewalld on Fedora22

Frank Millman frank at chagford.com
Thu Sep 24 12:37:35 UTC 2015


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. 





More information about the samba mailing list