Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • 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 2012
    • 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.

5 comments
3
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

Configure User’s Folder Redirection with Group Policy

February 3, 2023

Disable Built-in PDF Viewer in Microsoft Edge

February 3, 2023

Join a Windows Computer to an Active Directory...

February 2, 2023

Using Previous Command History in PowerShell Console

January 31, 2023

How to Install the PowerShell Active Directory Module...

January 31, 2023

5 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

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

  • Configure User’s Folder Redirection with Group Policy

    February 3, 2023
  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Configuring Port Forwarding in Windows
  • Installing RSAT Administration Tools on Windows 10 and 11
  • Manage Windows Updates with PSWindowsUpdate PowerShell Module
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Get-ADUser: Find Active Directory User Info with PowerShell
  • 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