1

I'm trying to set up an old Raspberry Pi to be a simple file server on a home network. I've mounted a couple of USB sticks to use as storage; The first will appear as storage that's visible on Samba and the second will be a backup of the first; every night it runs rsync to back everything up.

It Pi it's self have an IP address that is dynamically allocated, so it will look something like 192.168.1.xx

I've almost got everything working the way I want it, except Windows 10 explorer won't connect to the samba share as \\my-pi\share. If I use the Windows command prompt to ping my-pi it sees the device and tells me the IP address. Knowing the address I can then connect to samba as \\192.168.1.123\share

As the Pi's IP address is dynamic this could change every time the system is rebooted, so I really do want to use the hostname.

My best guess is that I've got a setting wrong in /etc/samba/smb.conf. I've gone through the documentation, but can't see the problem (not that I understand all of it).

6
  • Just a guess: Windows may need some help using the zero config networking scheme used by the RPi. This article might help
    – Seamus
    Aug 7, 2021 at 23:00
  • This is a Windows problem. Just because you use DHCP doesn't mean you can't have a predictable IP Address. See raspberrypi.stackexchange.com/a/121830/8697
    – Milliways
    Aug 7, 2021 at 23:55
  • @Milliways, My home router does allow allow me to assign a specific IP address to a given MAC. I guess I could also edit the System32\drivers\etc\hosts file on my PC to map that IP address back to the host name.... It feels the the wrong solution, but if I've only got a couple of PC's on the network it would probably work. Updating the etc/hosts file on my Android phone would be more difficult... I'm guessing that what I thought was a Samba problem is really a problem with pi networking?
    – Stormcloud
    Aug 9, 2021 at 12:41
  • @Stormcloud you obviously didn't read the linked post which suggests request - nothing to do with fiddling with hosts or routers. This is not "a problem with pi networking" it is a Windows problem. On most OS hostname.local works; Windows doesn't support zero config networking standard, and each release seems to operate differently.
    – Milliways
    Aug 9, 2021 at 12:58
  • @Milliways, I had read it - it was the inspiration behind my reply. My understanding is (and please correct me if I'm wrong) that the pi asks the DHCP sever if it can be given a particular IP address. My home router, which acts as the DHCP server, allows me to assign a specific IP for a given MAC. I think this should achieve the same thing as the linked post suggested. The advantages for configuring the router is that I have multiple pi's, so I would only have to configure one device. I can also see if I've accidentally set up a clash of IP addresses....
    – Stormcloud
    Aug 9, 2021 at 16:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.