0

I have Samba installed on a Ubuntu 14.04 server, in my smb.conf I have

interfaces = lo em1
bind interfaces only = yes

This should make Samba bind to only the loopback and the first embedded network card, but it actually only binds to lo

root@server:~# lsof -ni:139
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
smbd    830 root   29u  IPv4  11311      0t0  TCP 127.0.0.1:netbios-ssn (LISTEN)
smbd    830 root   31u  IPv6  11313      0t0  TCP [::1]:netbios-ssn (LISTEN)

If I comment these 2 lines in smb.conf it binds to em1 with no problems. What's happening there?

Sacha K
  • 377
  • 4
  • 18

1 Answers1

3

It's caused by em1 using DHCP. If the IP is static it works, and if using DHCP it works after I restart Samba.

Ubuntu is using upstart and samba is not set to be dependent on all network interfaces and will bind only to the available interfaces when it starts. See https://askubuntu.com/a/349142/332223

Sacha K
  • 377
  • 4
  • 18