Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Internet Connection Sharing (ICS) Stops Working After Reboot in Windows 10

September 20, 2021 PowerShellWindows 10

Internet Connection Sharing (ICS) Stops Working After Reboot in Windows 10

Internet Connection Sharing (ICS) service in Windows allows to share Internet connection on your computer with other devices in your local network (via Wi-Fi or Ethernet). This allows all computers on the local network to access the Internet via an Internet connection on one computer (the computer may be connected to the Internet via 5G/4G/LTE modem, direct cable connection via a second adapter, satellite connection, PPPoE, VPN, etc.). In this case, this Windows computer with two network interfaces connected to different networks will be a network gateway to other devices. ICS is a built-in Windows service that provides network connection sharing, address translation (NAT), and DHCP server functionality.

Also, you can use ICS to turn your Windows 10 device into a mobile hotspot.

You can enable shared access to a network connection in Windows in the properties of the network adapter (Sharing tab -> Internet Connection Sharing -> Allow other network users to connect through this computer’s Internet connection).

ICS sharing not working after windows 10 reboot

There is one unpleasant drawback in modern Windows 10 builds: if a computer with a shared network connection is restarted, other computers in a local LAN/Wi-Fi network lose Internet access.

The matter is that in modern Windows 10 builds Internet Connection Sharing service is disabled in 4 minutes and it does not restart automatically if no traffic goes through the shared connection. To restore shared Internet access, you need to uncheck and check the shared access option in the properties of the network adapter Windows is using to connect to the Internet.

To enable Internet Connection Sharing to start automatically after restarting Windows 10, enable a DWORD registry parameter EnableRebootPersistConnection with the value 1 in the reg key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\SharedAccess.

It is easier to create a registry parameter using this PowerShell command:

New-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\SharedAccess -Name EnableRebootPersistConnection -Value 1 -PropertyType dword

EnableRebootPersistConnection registry key

Then set the automatic startup for the Internet Connection Sharing service (SharedAccess). You can change the startup type from Manual to Automatic in services.msc or using PowerShell:

Set-Service SharedAccess –startuptype automatic –passthru

Start the service:

Start-Service SharedAccess

internet connection sharing - configure service autostart on windows 10

You can also use the following PowerShell script to find all network connections with the shared Internet access on the computer, disable shared access and re-enable it again.

$NetShareObject = New-Object -ComObject HNetCfg.HNetShare
$list = New-Object System.Collections.Generic.List[System.Object]
foreach( $connection in $NetShareObject.EnumEveryConnection ){
$config = $NetShareObject.INetSharingConfigurationForINetConnection( $connection )
if( $config.SharingEnabled -eq 1 ){
$type = $config.SharingConnectionType
$list.Add( @($type,$config) )
$config.DisableSharing( )
}
}
Start-Sleep 1
foreach( $array in $list ){
$array[1].EnableSharing($array[0])
}

You can run the PowerShell script automatically using Windows Task Scheduler at the computer startup.

7 comments
4
Facebook Twitter Google + Pinterest
previous post
Fix: Windows Cannot Connect to the Shared Printer
next post
Checking Active Directory Domain Controller Health and Replication

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Send Emails with Microsoft Graph API and PowerShell

November 6, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

7 comments

glnz September 21, 2021 - 10:42 am

Dear Woshub – Just now, connecting to this site, I got security warnings on my Firefox that your site is not secure. Apparently, you are only HTTP, not HTTPS. Is that correct?

Reply
admin September 21, 2021 - 10:44 am

It’s ok, at the moment we have not switched to https

Reply
Allan July 11, 2022 - 8:02 pm

Amazing….have been looking for a solution to this since upgrading to windows 10. Reg hack does the trick for me. Thanks so much

Reply
Joe December 8, 2022 - 5:24 am

You’re amazing, thanks. I’ve been trying to figure out how to disable then re-enable ICS through Powershell, but it’s been a real doozy. This worked perfectly.

Reply
Vit February 3, 2023 - 11:51 am

Much obliged. Worked like a charm on Win10 21H2 LTSC.

Reply
Andy February 24, 2023 - 8:40 am

Fantastic ! This is exactly what i need for a Qemu VM !
Rhank you for sharing !

Reply
Kamil November 8, 2023 - 12:54 pm

Finally, thanks!

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Manage Windows Updates with PSWindowsUpdate PowerShell Module
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • Adding Drivers into VMWare ESXi Installation Image
  • How to Hide Installed Programs in Windows 10 and 11
  • Configuring SFTP (SSH FTP) Server on Windows
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top