Sambashare Not Working After Switching from WiFi to Ethernet on Raspberry Pi

Abstract: Fix Sambashare not working after switching from WiFi to Ethernet on Raspberry Pi by updating the interfaces parameter in smb.conf.

Created: 2026-09-19 by
Sambashare fails after switching from WiFi to Ethernet on a Raspberry Pi because the network interface name changes, causing Samba’s default configuration to bind only to the old wireless interface. You must update the interfaces parameter in smb.conf to include the new Ethernet device or set it to * for all interfaces. This ensures the service listens on the active connection regardless of whether you use WiFi or wired networking.

Understanding the Interface Binding Issue

When you connect your Raspberry Pi via Ethernet, the operating system assigns a different network interface identifier than it did when using WiFi. Typically, WiFi interfaces are named wlan0 or similar, while Ethernet interfaces are named eth0. If your Samba configuration explicitly restricts listening to specific interfaces, it will ignore the new Ethernet connection.

This behavior is often intentional in server environments to prevent security leaks, but for a home NAS or file share, it causes connectivity issues. The symptom is usually that other devices on the local network can ping the Pi, but attempts to access //raspberrypi or //192.168.x.x time out or fail with "Network Path Not Found." This happens because Samba is not broadcasting its presence on the Ethernet subnet.

For more context on how network interfaces behave during transitions, see our guide on Troubleshooting Linux Device Not Reachable During Network (Ping).

Locating and Editing smb.conf

The primary configuration file for Samba is located at /etc/samba/smb.conf. You need root privileges to edit this file safely. Open a terminal on your Raspberry Pi and use a text editor like nano:

sudo nano /etc/samba/smb.conf

Scroll down until you find the [global] section. Look for a line that starts with interfaces. It might look like this:

interfaces = wlan0 127.0.0.0/8 ::1/128

If this line exists, it tells Samba to only listen on wlan0. When you switch to Ethernet, eth0 is ignored. In many cases, this line may be commented out with a semicolon (;interfaces = ...) or missing entirely, which means Samba should listen on all interfaces by default. However, if it is present and active, it is the culprit.

Updating the Configuration

You have two main options to fix this: binding to the specific Ethernet interface or allowing all interfaces. The most robust solution for a dynamic environment is to allow all interfaces.

Option 1: Listen on All Interfaces

To make Samba work regardless of whether you use WiFi or Ethernet, comment out the interfaces line or remove it entirely. Alternatively, you can set it to accept any address:

interfaces = *

However, the standard and safest approach is simply to ensure the line is commented out so Samba defaults to binding to all available network cards. If you prefer explicit control, you can list both:

interfaces = eth0 wlan0

Option 2: Bind to Specific Subnets

If you want to restrict Samba to your local LAN only, you can specify the subnet mask instead of interface names. For example:

interfaces = 192.168.1.0/24

This ensures Samba listens on any interface connected to the 192.168.1.x network, whether it arrives via WiFi or Ethernet.

For deeper insights into network bridging issues that might affect interface visibility, check out Ubuntu Server on Raspberry Pi 4: Layer2 WiFi-Eth Bridge Not Forwarding DHCP Requests.

Restarting and Verifying Samba

After saving the changes to smb.conf, you must restart the Samba services for the changes to take effect. Run the following commands:

sudo systemctl restart smbd
sudo systemctl restart nmbd

The smbd service handles file sharing, while nmbd handles NetBIOS name resolution (allowing you to access the share by hostname like //raspberrypi). If you do not restart nmbd, you might still be able to connect via IP address but fail to resolve the name.

Verify that Samba is now listening on the correct ports using netstat or socat:

sudo netstat -tlnp | grep smbd

You should see output indicating that smbd is listening on port 445 (TCP) across all interfaces or specifically on the Ethernet IP address. Additionally, test connectivity from another device on the same network. Try pinging the Pi's new Ethernet IP, then attempt to map the network drive or access the share via your file explorer.

Troubleshooting Firewall Rules

If Samba is configured correctly but still inaccessible, check your firewall settings. Raspberry Pi OS typically uses ufw (Uncomplicated Firewall). Ensure that traffic on ports 139, 445, and 137-138 is allowed.

sudo ufw status

If the status shows inactive, firewalls are not the issue. If it is active, ensure the Samba application profile is enabled:

sudo ufw app info 'Samba'

If rules are blocking incoming connections, enable them:

sudo ufw allow samba

Remember that changing networks can sometimes trigger firewall zone changes depending on your setup. Always verify that the firewall allows traffic on the subnet associated with your Ethernet connection.

Frequently Asked Questions

Why can I ping the Raspberry Pi but not access Sambashare?

Ping uses ICMP protocol, which operates at a lower layer than the TCP/IP ports used by Samba. Your network route is working, but Samba is likely bound to the wrong interface or blocked by a firewall rule specific to SMB ports. Check the interfaces setting in smb.conf first.

Does restarting the Raspberry Pi fix the interface binding issue?

No, a reboot does not change the Samba configuration. While the Pi will recognize the new Ethernet interface, Samba will continue to ignore it if smb.conf still points to the old WiFi interface. You must manually edit the configuration file to resolve this.

How do I find my Raspberry Pi's new Ethernet IP address?

Run the command ip addr show eth0 in the terminal. Look for the inet value under the eth0 section. This is the IPv4 address you should use to connect to the share if hostname resolution fails.

What is the difference between smbd and nmbd?

smbd provides the actual file and printer sharing services over TCP ports 139 and 445. nmbd provides NetBIOS name services, allowing devices to find the Pi by name rather than just IP address. Both need to be restarted after configuration changes.

Can I use a static IP to prevent future connectivity issues?

Yes, assigning a static IP to your Raspberry Pi via /etc/dhcpcd.conf ensures the address remains constant. However, this does not solve the Samba interface binding issue; you still need to update smb.conf to listen on the Ethernet interface.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More