0

I have installed and configured avahi-daemon and samba on Centos 6.6 and it's working when I am testing it from an Ubuntu machine. e.g.: ping myhostname.local or smb://myhostname.local

However, when I try from a windows machine, neither samba works nor I can ping it via ping myhostname

Can anyone please explain me the possible difference between what Windows does and what Ubuntu does.

Besides, it would be great if Windows could list my server when browsing network, but I don't know if I should enable something like a broadcast or just normal configuration is adequate.

Thanks a log in advance.

Sheric
  • 146
  • 7

2 Answers2

0

What helped me was to permanently allow TCP/UDP ports 548, 5353, 5354 on my CentOS 7 firewall (the firewalld service, controlled by firewall-cmd commands). My references was:

Commands:

sudo firewall-cmd --zone=public --add-port=548/udp --permanent
sudo firewall-cmd --zone=public --add-port=548/tcp --permanent
sudo firewall-cmd --zone=public --add-port=5353/udp --permanent
sudo firewall-cmd --zone=public --add-port=5353/tcp --permanent
sudo firewall-cmd --zone=public --add-port=5354/udp --permanent
sudo firewall-cmd --zone=public --add-port=5354/tcp --permanent

Then reboot or restart firewalld.

Notes

  • The question is relatively old, and it was strangely phrased to use CentOS 7 in subject but mentioned CentOS 6 in the post, causing me to land here.
  • The OP's own answer did not help me. Also, I use Windows 7 for the Windows side, and it DOES work with mDNS (avahi) running on Linux hosts.
  • I solved this differently using my aforementioned method.
  • I am posting my solution here in case anybody else also lands here trying to solve this issue on CentOS 7.
charlesz
  • 101
  • 1
0

After 2 days of working and researching on it, thanks to Wireshark, I figured out that Windows doesn't use mdns protocol for resolving hostnames and just queries with its own protocol, NetBios. Therefore, obviously Avahi won't response to it.

Taking another look I found this guide: http://sharadchhetri.com/2014/10/09/centos-7-rhel-7-install-and-setup-samba-server-file-sharing/ which followed by the following conclusion:

Samba includes a daemon called nmb which handles NetBios Requests but it was disabled by default in Centos 7. After starting it, windows could easily resolve my hostname.

Sheric
  • 146
  • 7