Internet Connection Sharing stopped working after Windows 10 Anniversary Update

8

9

Since updating to Windows 10 1607 (the "Anniversary Update") my shared WiFi adapter isn't shared any more.

I share the WiFi connection with a Hyper-V switch so that my VMs have Internet access via the Surface Pro 2's WiFi connection. But since the update, this only works after manually disabling and re-enabling Internet Connection Sharing. Otherwise the internet sharing doesn't work even though the option is set in WiFi properties.

An ideas?

Internet Connection Sharing

Andrew J. Brehm

Posted 2016-08-07T18:13:07.053

Reputation: 4 411

Answers

7

This is a script that I use now and it works:

param(
    $sPublicAdapterName,
    $sPrivateAdapterName
)

if (!$sPrivateAdapterName) {
    Write-Host "EnableSharing.ps1 sPublicAdapterName sPrivateAdapterName"
    return
}#if

# Constants
$public = 0
$private = 1

Write-Host "Creating netshare object..."
$netshare = New-Object -ComObject HNetCfg.HNetShare

Write-Host "Getting public adapter..."
$publicadapter = $netshare.EnumEveryConnection | Where-Object {
    $netshare.NetConnectionProps($_).Name -eq $sPublicAdapterName
}#foreach

Write-Host "Getting private adapter..."
$privateadapter = $netshare.EnumEveryConnection | Where-Object {
    $netshare.NetConnectionProps($_).Name -eq $sPrivateAdapterName
}#foreach

Write-Host "Disabling and enabling public sharing for public adapter...."
$netshare.INetSharingConfigurationForINetConnection($publicadapter).DisableSharing()
$netshare.INetSharingConfigurationForINetConnection($publicadapter).EnableSharing($public)
$netshare.INetSharingConfigurationForINetConnection($publicadapter)

Write-Host "Disabling and enabling private sharing for private adapter...."
$netshare.INetSharingConfigurationForINetConnection($privateadapter).DisableSharing()
$netshare.INetSharingConfigurationForINetConnection($privateadapter).EnableSharing($private)
$netshare.INetSharingConfigurationForINetConnection($privateadapter)

# Clean up
Remove-Variable netshare

Andrew J. Brehm

Posted 2016-08-07T18:13:07.053

Reputation: 4 411

It's the script linked to by @Dmitriy Bykov above slightly modified. – Andrew J. Brehm – 2016-09-09T21:10:44.997

Question - what exactly are sPublicAdapterName and sPrivateAdapterName, how do I know the correct names? (by the way, I asked this question, but nothing works for me after the anniversary update)

– Kobi – 2016-09-24T15:53:39.187

1They are the adapter names as given by ipconfig.exe or the Network Connections control panel. sPublicAdapterName is the one connected to the outer network (ultimately the Internet), sPrivateAdapterName is the one you want to share the connection on. On my Surface Pro they are called Wifi and vEthernet since I am sharing the Internet connection of the Wifi network with the Hyper-V network inside the tablet. – Andrew J. Brehm – 2016-10-01T20:01:39.217

@AndrewJ.Brehm could you be more specific how to set this up? I am not Windows 8+ (super)user but I am the only one that can help my friend. Could you please make screenshot with ipconfig and circle whole name that should be put as parameter. What if my "private" network is always "Unidentified Network" - but ping between the machines work. host - 192.168.137.1, client - 192.168.137.x – Kyslik – 2016-10-02T18:04:04.957

From user Jzep: In which application do I have to run the code and where exactly do I have to enter my adapter names? Do I only need to replace sPublicAdapterName and sPrivateAdapterName? Do I only need to replace the part where "Name" stands?

– fixer1234 – 2018-12-02T00:12:06.987

This answer contains a PowerShell script – Ramhound – 2018-12-02T02:31:30.910

4

I have the same problem.

After reboot the "Internet Connection Sharing" doesn't start, its startup state set to Manual (Triggered). But even if I start it manually or set startup state to "Automatic", the service starts and keeps working, but there is no Internet access in my home network until I disable and re-enable ICS on my WAN interface.

I triple checked this behavior by clean installation of W10 build 1607, it acts always the same. I tried different driver versions for my network adapters - default from Windows Update, latest version from Intel website and latest drivers provided by my laptop manufacturer - the problem still exists.

I also made a clean installation of W10 build 1511 and the Internet Connection Sharing was working perfect, until I installed the Anniversary Update. After upgrade, ICS service startup state was set to "Automatic" and it was started on system startup, but the internet access in my home network didn't work until disabling/re-enabling the ICS on WAN interface.

Funny thing - Internet Connection Sharing definitely worked just fine on my old laptop with Windows 10 build 1607, but now I sold it and I there's no way to find a difference in configuration to figure out the problem. I faced this problem only after I bought my current laptop (Dell Precison M4800) a week ago. But since I tried clean Windows installation and different drivers I don't think its related only to my computer, especially because there are another people having this problem after Anniversary Update:

http://answers.microsoft.com/en-us/windows/forum/windows_10-networking/ics-internet-connection-sharing-dosent-work-in/a203c90f-1214-4e5e-ae90-9832ae5ceb55

http://answers.microsoft.com/en-us/windows/forum/windows_10-networking/internet-connection-sharing-no-longer-works-ver/1c8ffdff-84e8-4124-b1a5-379df6eb2959

So reverting to Win10 build 1511 seems to be the only solution at the moment.

UPD: Here is a workaround - you can schedule running a script each time the computer starts, which will disable and re-enable ICS on desired interfaces.

You can take a script from this thread: How to enable Internet Connection Sharing using command line?

Dmitriy Bykov

Posted 2016-08-07T18:13:07.053

Reputation: 41

2

I've had the same issue today. Its working again now, but I'm not sure exactly what fixed it.

I had compared the ICS settings with another computer which hadn't had the anniversary update (and ICS worked fine) and they were exactly the same.

The things which most likely sorted it were:

  1. Manually started the Internet Connection Sharing service

  2. Windows Defender had a definitions update via Windows Update

I also plugged a laptop into the computer where ICS wasn't working to test if it could be assigned an IP address and access the Internet. It started working straight away and since then, the original device (a VOIP phone) has also worked fine.

Sorry I can't be more specific, but hopefully this will be of some use!

playerone

Posted 2016-08-07T18:13:07.053

Reputation: 21

Just thought I'd add, I share a WiFi connection to a VOIP phone plugged into my computer's Ethernet port. – playerone – 2016-08-08T16:16:19.080

0

The problem is in your firewall's advanced settings. Click on "Windows Firewall Properties", then for public profile, the inbound connections is set to "Block all connections" instead of "Block (default). Set it to "Block (default)". Verify your fix at the guest computer by running ping 192.168.137.1, or whatever ip that you have it manually set to.

elemenos

Posted 2016-08-07T18:13:07.053

Reputation: 11

1How would changing settings in the firewall re-activate Internet Sharing when it is off? – Andrew J. Brehm – 2017-01-03T10:19:07.853

@AndrewJ.Brehm The firewall and ICS have some common components or are the same thing in Windows (and other OSes - NAT & firewall are both done by iptables for example). After setting up ICS, some special and unmodifiable rules show up in the firewall, and they are not firewall rules, they are NAT rules. – Tiberiu-Ionuț Stan – 2017-08-31T06:43:19.633

Did you see the working solution? Nothing to do with the Firewall. – Andrew J. Brehm – 2017-09-01T19:51:30.570

0

The up-to-date official fix is to create the following entry in the Windows registry:

Path: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedAccess
Type: DWORD
Setting: EnableRebootPersistConnection
Value: 1

Official description contains one slightly misleading statement:

This solution is currently available only in Windows 10 Version 1709 with update KB 4054517 installed.

but the fix worked for me on Windows 10 version 1903 build 18362.657.

i3v

Posted 2016-08-07T18:13:07.053

Reputation: 970

Previously, I used powershell-based stop-sharing + start-sharing script, like described in the accepted answer, and I can confirm it works too. But this reghack feels easier and cleaner.

– i3v – 2020-02-24T17:10:39.513