Cannot connect to Windows share via local network IP address, but can by localhost

7

8

I'm stuck a bit in figuring out why can not I access Windows Shared Folder via my local network address even from the very computer that exposes the share.

When I try to see shared folder via \\localhost everything works out, I can see the files.

localhost -- ok

However, when I try to connect from the very same computer via my local network address (192.168.1.2) it shows the listing of folders but fails to open it.

enter image description here

I can ping my address (192.168.1.2) with no problems. Firewall is turned off. No antivirus. I have turned on both "File and printer sharing" and "network discovery".

Microsoft Windows [Version 10.0.15063]

Here is how my ipconfig looks like, nothing suspicious.

C:\Users\nrj>ipconfig /all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : EUGENE-PC
   Primary Dns Suffix  . . . . . . . :
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter local:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : <hidden>
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::c0cf:f044:74d2:c5ec%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.1.2(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Saturday, August 12, 2017 14:57:30
   Lease Expires . . . . . . . . . . : Sunday, August 13, 2017 14:57:30
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCP Server . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 190858699
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-9B-1E-0E-00-1F-C6-78-EC-28
   DNS Servers . . . . . . . . . . . : 192.168.1.1
   NetBIOS over Tcpip. . . . . . . . : Disabled

Netstat for 445 port:

C:\Users\nrj>netstat -a | findstr /R /C:.*445.*
  TCP    0.0.0.0:445            EUGENE-PC:0            LISTENING
  TCP    [::]:445               EUGENE-PC:0            LISTENING

What else can I check to figure this out?

UPD. Network adapter properties shows that "File and Printer Sharing" is enabled.

network adapter properties

Just to be clear, again, 192.168.1.2 is address of my computer from which I try to access my own file share and it does not work. Here is the routes table.

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1      192.168.1.2     35
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.1.0    255.255.255.0         On-link       192.168.1.2    291
      192.168.1.2  255.255.255.255         On-link       192.168.1.2    291 <- see here
    192.168.1.255  255.255.255.255         On-link       192.168.1.2    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link       192.168.1.2    291
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link       192.168.1.2    291

UPD 2. netcfg output here: https://pastebin.com/zRa7wi1t.

Eugene D. Gubenkov

Posted 2017-08-12T12:20:32.573

Reputation: 137

@McDonald's, I've added screenshot with window you are asking about. And sorry for being not clear enough, 192.168.1.2 is my local network address of the computer that exposes file share, and I can not access this file share from this very computer that exposes it (source and destination is the same machine), not even talking about accessing from other devices. – Eugene D. Gubenkov – 2017-08-17T04:57:14.613

What happens if you try to access the share via \\127.0.0.1\temp? – I say Reinstate Monica – 2017-08-18T00:03:32.853

@EugeneD.Gubenkov Type in network reset from Cortana by pressing the win key once then then typing it in. Once you see Network Reset populate up top, click on it. Once in the Network Reset windows select the Reset now option and then once the PC restarts, try enabling and/or disabling "NetBIOS over TCP/IP" afterwards. May be related to a WIndows Update if this works... see here: http://www.tomshardware.com/answers/id-3241432/netbios-tcpip-disabled-matter.html

– Pimp Juice IT – 2017-08-19T18:58:12.203

Furthermore, look over Fix network connection issues in Windows 10 as reading over this and using any of these as potential solutions or things to try or rule out should be simple enough. Last but not least look over the very thorough and detailed How to enable and disable SMBv1, SMBv2, and SMBv3 in Windows and Windows Server—there is Windows 10 information in here.

– Pimp Juice IT – 2017-08-19T19:05:19.453

@McDonald's, thanks for another suggestion! I just did network reset, restarted, Ethernet connection was recreated, then I've enabled "netbios over tcp/ip" and still it shown as "disabled" in ipconfig. Here is troubleshooter output: https://www.dropbox.com/s/rltnq3qwqtjsqod/troubleshooter-201708.pdf?dl=0

– Eugene D. Gubenkov – 2017-08-20T07:12:25.333

@McDonald's, here is output of Get-SmbServerConfiguration PowerShell snap-in: https://pastebin.com/CqP9wk7J. It shows that SMBv1/SMBv2 seem to be enabled...

– Eugene D. Gubenkov – 2017-08-20T07:16:08.760

Answers

11

When you posted this question 6 months ago, in my efforts to reproduce your problem I disabled then later re-enabled NetBIOS over TCP/IP in the Advanced TCP/IP Settings of my network adapter. A few weeks later I discovered I was having the same problem described in the OP (except, I did it to myself). I ended up fixing the problem after hours of research which culminated in painstakingly comparing the Registries of a working computer with my non-working machine.

Here's the solution I discovered. (You might want to grab a beer first...)

Step A: Get the GUID of your network adapter

You will need your network adapter's GUID. It looks something like this:

{DED7C856-1234-5678-BA7E-FF9BF300F579}

Here are two ways to get it:

Via PowerShell:

  1. Run this:

    Get-NetAdapter | fl Name,Status,InterfaceDescription,Status,MacAddress,LinkSpeed,InterfaceGuid
    
  2. Make note of the adapter's InterfaceGuid value.

Via Command Prompt (source):

  1. If necessary, use the Services MMC snap-in (run services.msc) to start the Wired AutoConfig service (for wired network interfaces) or WLAN AutoConfig service (for wireless interfaces).

  2. Run the command corresponding to your type of interface:

    Wired:       netsh lan show interfaces
    Wireless:  netsh wlan show interfaces

  3. Make note of the GUID value (it will be displayed without the surrounding braces, which you need to add).

Step B: Edit the Registry

  1. Run regedit to open the Registry Editor.

  2. Navigate to the following key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Linkage

  3. For each of the three values in the table below (Bind, Export, and Route), double-click the value to open the Value data editor.

  4. Inspect the Value data for the strings shown in the Data column of the table below. When the table shows {GUID} replace that with the actual GUID of your network adapter, including the surrounding braces. For example, if your adapter's GUID is {DED7C856-1234-5678-BA7E-FF9BF300F579} according to the table below the Bind value in the Registry should have the following two entries:

    \Device\Tcpip_{DED7C856-1234-5678-BA7E-FF9BF300F579}
    \Device\Tcpip6_{DED7C856-1234-5678-BA7E-FF9BF300F579}
    
  5. Add any Data values that are missing as new lines at the end of the text box. Do this for each value shown in the table.

Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Linkage

+--------+-----------------------------+
| Value  | Data                        |
+--------+-----------------------------+
| Bind   | \Device\Tcpip_{GUID}        |
|        | \Device\Tcpip6_{GUID}       |
+--------+-----------------------------+
| Export | \Device\NetBt_Tcpip_{GUID}  |
|        | \Device\NetBt_Tcpip6_{GUID} |
+--------+-----------------------------+
| Route  | "Tcpip" "{GUID}"            |
|        | "Tcpip6" "{GUID}"           |
+--------+-----------------------------+
  1. Repeat steps 2 through 5 for each of the following tables (for this following table, you'll use the data table for both keys shown):
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Linkage
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Linkage

+-------+-----------------------------+
| Value | Data                        |
+-------+-----------------------------+
| Bind  | \Device\Tcpip_{GUID}        |
|       | \Device\Tcpip6_{GUID}       |
|       | \Device\NetBT_Tcpip_{GUID}  |
|       | \Device\NetBT_Tcpip6_{GUID} |
+-------+-----------------------------+
| Route | "Tcpip" "{GUID}"            |
|       | "Tcpip6" "{GUID}"           |
|       | "NetBT" "Tcpip" "{GUID}"    |
|       | "NetBT" "Tcpip6" "{GUID}"   |
+-------+-----------------------------+
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Linkage

+--------+------------------------------------------+
| Value  | Data                                     |
+--------+------------------------------------------+
| Export | \Device\LanmanServer_Tcpip_{GUID}        |
|        | \Device\LanmanServer_Tcpip6_{GUID}       |
|        | \Device\LanmanServer_NetBT_Tcpip_{GUID}  |
|        | \Device\LanmanServer_NetBT_Tcpip6_{GUID} |
+--------+------------------------------------------+
Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Linkage

+--------+-----------------------------------------------+
| Value  | Data                                          |
+--------+-----------------------------------------------+
| Export | \Device\LanmanWorkstation_Tcpip_{GUID}        |
|        | \Device\LanmanWorkstation_Tcpip6_{GUID}       |
|        | \Device\LanmanWorkstation_NetBT_Tcpip_{GUID}  |
|        | \Device\LanmanWorkstation_NetBT_Tcpip6_{GUID} |
+--------+-----------------------------------------------+

Step C: Reboot

Reboot your computer for the changes to take effect.

I say Reinstate Monica

Posted 2017-08-12T12:20:32.573

Reputation: 21 477

Wow! Appreciate you posting this research! I'm a bit sad that I'm not able to check the solution myself, because since that I've changed my SSD and reinstalled Windows with it. You rock! – Eugene D. Gubenkov – 2018-02-18T05:34:30.850

This indeed solves this problem where port 445 is open and listening but a remote computer can't initiate a telnet connection and obviously won't be able to use any of the File and Print Sharing features. Something screwed the bindings of the NetBT and both Server and Workstation services. Server was working fine and overnight smb stopped working. After a few days and at least 100 posts, threads, blog entries this was the first one that hit the nail in the head.Good thing it made me remove SMB1 and move on to 2 and 3 plus I learned a few things in the process. – Mircea Ion – 2018-04-26T06:47:15.863

6

To automate the Twisty Impersonator solution I have developed a command line program named ShareFix.

Sorry if this looks like an ad but it works.

Filippo Bottega

Posted 2017-08-12T12:20:32.573

Reputation: 61

1

As a shortcut for the registry hack described above, you can open Control Panel, browse to adapter settings then, interface properties, disable Network and File Sharing, then reopen the window and enable it again.

enter image description here

This apparently gets Windows to rethink all LanManServer's adapter bindings. It's a million pities that this should be necessary!

BobHy

Posted 2017-08-12T12:20:32.573

Reputation: 121

I'm glad this worked for you. FWIW, this didn't fix the problem for me, so it must mean this can fix the problem in certain circumstances. But this is worth a try before going on to more involved fixes! – I say Reinstate Monica – 2019-04-03T22:00:39.310

0

The only difference I see from my PC compared to yours, from what you have shared, is the NETBIOS over Tcpip. Mine shows enabled, while yours is showing disabled, so that should be an easy enough setting to see if it fixes your problem.

From the Ethernet Adapter Properties window, double click the Internet Protocol Version 4 (TCP/IPv4) to bring up the IPv4 Properties windows.
enter image description here

Select the "Advanced" button.
enter image description here

Then choose the WINS tab, and enable the NetBIOS setting. Mine is at default, so choose to enable it if it's set to default.
enter image description here

Restart the computer and see if it worked.

UPDATE:

netstat -an -p tcp

This will return IP address with IP address that are connected, if they're connected, and if the link is established or listening. I've omitted text from my result to show only what is relevant.

    Active Connections

    Proto  Local Address          Foreign Address        State
    TCP    192.168.1.15:139       0.0.0.0:0              LISTENING
    TCP    192.168.1.15:445       192.168.1.31:53594     ESTABLISHED
    TCP    192.168.1.15:445       192.168.1.33:33598     ESTABLISHED

I have two connections to my share from 2 different IP address, just wanted to show as an example.

Port 139 is for our NetBIOS Session Service
Port 445 is for our SMB file sharing

Regards,

Chris

tfrue

Posted 2017-08-12T12:20:32.573

Reputation: 171

Valid suggestion, thanks for noticing! Interestingly enough I have this enabled in the UI, but ipconfig shows "disabled". Tried to disable/enable it with no luck. I've even recorded screencast with settings: https://www.screencast.com/t/1GiKTaPqy

– Eugene D. Gubenkov – 2017-08-17T17:40:46.680

Maybe try "default" and be sure to restart. I'm sure you have, but you really haven't confirmed it with us yet. – tfrue – 2017-08-18T02:38:18.083

Also, what version of Windows 10 are you using? Windows 10 Home, Pro, Enterprise? Maybe you have a Group Policy setting in place that is causing an error. Can you tell us of any changes you may have made that would affect the network in anyway? Maybe the hosts file or the network file, etc... – tfrue – 2017-08-18T02:39:42.033

1I've restarted without any luck, still "disabled" in ipconfig output. Using Windows 10 Enterprise. Host file is regular, just couple of malicious host names pointing to 127.0.0.1. Did not manually alter any group policies... – Eugene D. Gubenkov – 2017-08-18T04:00:58.470

Have you tried static IP address yet? Assign a static IP and reboot the PC. Have you tried to access the share from another computer on the network using the IP address? – tfrue – 2017-08-18T23:21:31.680

Try a static IP different than 192.168.1.2 and make sure that it's not being used on the network by a different device. – tfrue – 2017-08-19T01:43:57.113

Access from another computer does not work. Static IP did not help. Somehow I can not enable "NetBios over TCP/IP" -- even if it's enabled in properties UI, it does not show as enabled in ipconfig... – Eugene D. Gubenkov – 2017-08-19T12:10:54.200

See if the "TCP/IP NetBIOS Helper" service is enabled. Once enabled, try to disable and re-enable the network adapter and try to connect with the IP. Open services.msc from a command prompt, and search for "TCP/IP NetBIOS Helper" and make sure that it's enabled. If it is and it's still not working; Lets try to run an "sfc /scannow" from command prompt and let it scan the computer for corrupt windows files and then reboot the PC once it completes. If still no luck, we can try to make registry edits. – tfrue – 2017-08-20T03:24:51.003

@EugeneD.Gubenkov I thought I already suggested the SFC /SCANNOW in one of my past comments I deleted so did you ever actually try that as well as I suggested long ago? Additionally, I was able to disable and re-enable NetBIOS over TCP/IP and connecting from the same Windows machine via IP address, host name, and localhost all worked. This machine is trying to connect back to itself via the IP address and that is not working so I just don't see what NetBIOS over TCP/IP is going to do but I'm not a networking expert nor do I understand your entire network setup. – Pimp Juice IT – 2017-08-20T15:14:40.560

@EugeneD.Gubenkov Try rebooting the gateway of 192.168.1.1 and see if that makes any difference. You can also run from elevated command prompt nbtstat -n and then nbtstat -RR too see if that makes any difference. Check the DNS records from the DNS server for that IP address and the local HOSTS file to see if there are any bad pointers in there just in case. Maybe this is a NetBIOS issue and there's something I don't see but again when I tested and it was disable and enabled both from IPCONFIG it worked on my Windows 10 machine of the same build number. – Pimp Juice IT – 2017-08-20T15:22:39.990

@ChristopherJohnson, "TCP/IP NetBIOS Helper" is enabled. SFC reported "Windows Resource Protection did not find any integrity violations." – Eugene D. Gubenkov – 2017-08-20T16:30:48.333

@McDonald's, I've rebooted router (192.168.1.1) several times with no luck. nbtstat -n and nbtstat -RR both fail with the following message: "NetBT is not bound to any devices". hosts file is clean as a whistle. – Eugene D. Gubenkov – 2017-08-20T16:32:43.840

@McDonald's, by the way, I recently changed both, CPU and motherboard w/o reinstalling Windows -- could it be root cause of issue? Not sure it started right after that, but previously NetBIOS was definitely working in my setup. – Eugene D. Gubenkov – 2017-08-20T16:37:25.483

With Windows 10, it shouldn't matter because activation is supposedly bound to your Microsoft account. I would make sure the computer is up to date and all the drivers are updated for your network cards. Also, lets double check and make sure the computer is listening on the right ports.Run the command "netstat -an -p tcp" and look for the lines that have your IP address with the ports "139,445" set as "Listening." I've updated my answer to show this list. – tfrue – 2017-08-20T18:25:16.807

With Windows 10, it shouldn't matter because activation is supposedly bound to your Microsoft account. I would make sure the computer is up to date and all the drivers are updated for your network cards. Also, lets double check and make sure the computer is listening on the right ports.Run the command "netstat -an -p tcp" and look for the lines that have your IP address with the ports "139,445" set as "Listening." I've updated my answer to show this list. – tfrue – 2017-08-20T18:25:21.323

@ChristopherJohnson, it does listen here is the output: C:\WINDOWS\system32>netstat -an -p tcp | findstr /C:"445" /C:"135" TCP 0.0.0.0:135 0.0.0.0:0 LISTENING TCP 0.0.0.0:445 0.0.0.0:0 LISTENING – Eugene D. Gubenkov – 2017-08-21T17:57:35.310

You did find for port 135. Run the command without the pipe and see what you get. – tfrue – 2017-08-22T00:24:56.337

1This didn't work for me. Despite NetBIOS over TCP/IP being enabled in the dialog box, it still showed Disabled in ipconfig (same result by selecting "Default" in dialog box too). – I say Reinstate Monica – 2018-02-18T05:14:10.500

0

You cannot use an IP address to map a Microsoft Net Server (the backend of Windows File Sharing) if NetBIOS over TCP/IP is disabled. You must use the NetBIOS hostname, which is why \\localhost\temp works, but \\192.168.1.2\temp doesn't.

Try accessing \\EUGENE-PC\temp\ and it should work. I had the exact same issue with a Samba share on a server running a modified copy of FreeBSD being inaccessible at 192.168.1.250 (its LAN IP address), but fully accessible at griffNAS (its NetBIOS hostname).

Christopher Johnson's answer is changing a setting that allows the IP address to be resolved to a hostname if the DHCP server is configured for it. By sending the hostname in the first place, you circumvent the need for that setting.

Your machine is most likely directly hosting the files, so I susp

If that doesn't work, by any chance if you do nslookup 192.168.1.2, does it resolve to a hostname?

Do net share to check if the share even exists on the local Net server.

And are you 100% sure that the port is even open? Use telnet target 445 to check. If the screen goes black, it's open.

If it's open, try accessing it via net use \\192.168.1.2\

Make sure both network discovery and file and print sharing are enabled in Control Panel.. enter image description here

Source:

Why can't I map a drive via its IP address?

var firstName

Posted 2017-08-12T12:20:32.573

Reputation: 1 673

I get my media files from my pc to my firestick using a windows share and I use the IP address not the pc name, so I'm sure you are not enforced to use a name. – arana – 2017-08-17T15:34:10.410

Oops. Just re-read that article. 2000? Oh god. – var firstName – 2017-08-17T15:37:49.617

@arana However, if NetBIOS via TCP/IP is not enabled, afaik IP will not work. – var firstName – 2017-08-17T15:38:37.033

I've tried to enable NetBios and it let me update in UI, but ipconfig still shows "disabled". I've recorded screencast demonstrating an issue. https://www.screencast.com/t/KvNkwvkeBRM.

– Eugene D. Gubenkov – 2017-08-17T17:45:13.927

@EugeneD.Gubenkov did you reboot? – var firstName – 2017-08-17T17:50:29.910

1@varfirstName, reboot did not help, still shows "disabled" after the restart. – Eugene D. Gubenkov – 2017-08-18T03:58:28.337

1

@McDonald's I think the correct values for SetTcpipNetbios are 0 (Get from DHCP), 1 (Enabled), and 2 (Disabled). Source from TechNet

– I say Reinstate Monica – 2017-08-18T18:18:20.177

@McDonald's, ipconfig still shows "disabled" in "netbios over tcp/ip". I've recorded myself doing the commands that you have suggested: https://www.screencast.com/t/TvZpeKlD1. Not sure what the hell is going on...

– Eugene D. Gubenkov – 2017-08-18T19:27:21.353

@McDonald's, that is odd... I'm close to give up and reinstall windows... I've retried it with disabled "WinpkFilter" with no luck, moreover, I've lost when, but I no longer see anything listening on 445 port. https://www.screencast.com/t/EAoQsEwz.

– Eugene D. Gubenkov – 2017-08-18T20:10:31.357

Check this out, maybe this enabling it this way will let you do what you want: [Disable NetBios over TCP] [https://technet.microsoft.com/en-us/library/ms143696%28v=sql.90%29.aspx?f=255&MSPPError=-2147217396] – arana – 2017-11-25T01:12:44.697

0

  • The IP address 192.168.1.2 is assigned by DHCP on 192.168.1.1, then DHCP should provide NetBios settings.
  • I think if you use static IP address you will be able to enable NetBios.
  • Disable IPV6, IPV6 does not support NetBios: NetBIOS name resolution is not supported by Microsoft for Internet Protocol Version 6 (IPv6). https://en.wikipedia.org/wiki/NetBIOS
  • Try to create a workgroup and make the computers members of the workgroup, then create the share.
  • Check ports used by NetBios on Router:
  • UDP port 137

  • UDP port 138

  • TCP port 139

GirrefNuri

Posted 2017-08-12T12:20:32.573

Reputation: 19

1The fact that the OP is attempting to connect to his local machine, from his local machine, makes everything in this answer having to do with configuring off-computer network components irrelevant. – I say Reinstate Monica – 2017-08-23T01:47:06.230

disable ipv6 works for me. – warmblue – 2019-04-30T18:53:42.860

-1

i did what Filippo Bottega wrote, i run the file shrefix file and everything works again, i can see my shared folders. but today after two weeks the problem return. i run the file shrefix again and the problem still exists. so i did network reset (windows 10) and the problem finally fix. today i had another windows update and again i can't see my shreds folder even from my own pc. did another network reset and it fixes the problem, i can see my shared folders again. i think something in the update closes some service. thanks to everyone

gabby52525

Posted 2017-08-12T12:20:32.573

Reputation: 1