Troubleshooting Windows EC2 File Sharing: “No Network Provider Accepted the Path” Error


3 views

When your Windows Server 2003 EC2 instances can ping each other but fail to access shared folders with the "No Network Provider accepted the given network path" error, we're typically dealing with a layered networking/auth issue. Here's how to systematically break through.

# Verify basic connectivity first:
Test-NetConnection -ComputerName 10.0.1.25 -Port 445
tracert 10.0.1.25

Before diving deeper, ensure these fundamentals are covered:

  • Both instances in same VPC (cross-VPC requires peering)
  • Security group allowing TCP 445 (SMB) inbound/outbound
  • Windows Firewall exceptions for File and Printer Sharing

Windows Server 2003 defaults to SMBv1, which modern systems disable. Add these registry entries:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"SMB1"=dword:00000001
"SMB2"=dword:00000000

A common pitfall is mismatched permissions. Run this PowerShell snippet to audit:

Get-SmbShare | Select Name,Path,Description |
ForEach-Object {
    $share = $_
    Get-SmbShareAccess -Name $_.Name | 
    Select @{n='Share';e={$share.Name}},
           @{n='Path';e={$share.Path}},
           AccountName,AccessRight
}

Even when using IPs, Windows may perform reverse lookups. Add host entries:

# In C:\Windows\System32\drivers\etc\hosts
10.0.1.25    fileserver01
10.0.1.26    appserver01

When UNC paths fail, try mounting via PowerShell:

New-PSDrive -Name "X" -PSProvider "FileSystem" 
            -Root "\\10.0.1.25\ShareName" 
            -Persist -Credential (Get-Credential)

Or through net use command:

net use Z: \\10.0.1.25\ShareName /user:DOMAIN\username password

When all else fails, capture SMB traffic:

netsh trace start scenario=NetConnection capture=yes tracefile=C:\smb.etl
# Reproduce the error
netsh trace stop

When attempting to establish Windows file sharing between EC2 instances running Windows Server 2003 with IIS 6.0, you might encounter the frustrating "No Network Provider accepted the given network path" error despite confirmed ping connectivity. Let's break down the solution systematically.

First, verify these fundamental requirements:

  • Both instances must reside in the same VPC
  • Security Groups must allow SMB ports (TCP 445)
  • Windows Firewall exceptions for File and Printer Sharing
  • NetBIOS over TCP/IP enabled in network adapter properties

Here's the complete troubleshooting process:

1. Security Group Configuration

Add these inbound rules to your Security Group:

Type: Custom TCP Rule
Protocol: TCP
Port Range: 445 (SMB)
Source: The security group ID itself (sg-xxxxxx)

Type: All ICMP - IPv4
For ping verification

2. Windows Firewall Adjustment

Run these commands in Command Prompt on both instances:

netsh advfirewall firewall add rule name="SMB445" dir=in action=allow protocol=TCP localport=445
netsh advfirewall firewall add rule name="File and Printer Sharing" dir=in action=allow program="%SystemRoot%\system32\svchost.exe" service="fdrespub" enable=yes

3. Network Provider Order Verification

Check the network provider order in the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order]
"ProviderOrder"="lanmanworkstation,webclient"

When basic solutions fail, use these diagnostic tools:

Network Trace Analysis

net use * /d /y  # Clear existing connections first
net view \\<private-ip>  # Test connection
nbtstat -a <private-ip>  # Check NetBIOS name resolution

Packet Capture Analysis

Use Microsoft Network Monitor to capture SMB traffic:

Filter: Protocol.IPv4.Address == <private-ip> && Protocol.Tcp.Port == 445

If direct sharing remains problematic, consider these workarounds:

PowerShell Remoting

Enable-PSRemoting -Force
Enter-PSSession -ComputerName <private-ip> -Credential (Get-Credential)

WebDAV Configuration

For IIS-based sharing alternative:

# In IIS Manager:
1. Create virtual directory
2. Enable WebDAV authoring
3. Add write permissions
4. Set authentication to Windows Authentication