Events ID 4231 and 4227 Tcpip – no internet connection

Some Windows 10 users are facing a curious issue: The internet connection fails once a day – and isn’t revocable. Inspecting event protocol shows entries with ID 4231 and 4227.


Advertising


I stumbled upon this issue within this German Microsoft Answers forum thread, where a user describes the scenario. He looses once a day internet connection, although the network icon within the status bar shows a connection. First he was able to fix that issue with a re-boot. Later on he was forced to reset the network. He has changed the network card without an improvement. Searching the web brought me to this English Technet-forum discussion, where the same issue has been observed with Windows Server 2012:

Sometimes the server becomes inaccessible no network access anymore with 2 events:

ID 4227:

TCP/IP failed to establish an outgoing connection because the selected local endpoint was recently used to connect to the same remote endpoint. This error typically occurs when outgoing connections are opened and closed at a high rate, causing all available local ports to be used and forcing TCP/IP to reuse a local port for an outgoing connection. To minimize the risk of data corruption, the TCP/IP standard requires a minimum time period to elapse between successive connections from a given local endpoint to a given remote endpoint.

ID 4231:

A request to allocate an ephemeral port number from the global TCP port space has failed due to all such ports being in use.

Is there any way to resolve this? In previous version of windows server there was some registry entry for the tcpip parameters but they don’t seem to exists anymore.

Someone suggested the following workaround to avoid the exhausted TCP/IP connections.

1. Launch registry editor regedit.exe via Run as administrator.

2. Change the following registry entries.

Navigate to branch:


Advertising

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

and set the value TcpTimedWaitDelay to 30 seconds. Then navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

and set MaxUserPorts to 65,500. If the subkeys or the values are msising, just create them within registry editor. More details about the values mentioned above may be found at this Technet document.

Similar articles
Windows 10 Wiki
Check and repair Windows system files and component store
Windows 10: Open command prompt window as administrator
Windows 10 V1607: Update KB3206632 and the “no IP” fix – my findings


Advertising


This entry was posted in issue, Windows and tagged , , , . Bookmark the permalink.

1 Response to Events ID 4231 and 4227 Tcpip – no internet connection

  1. Michael says:

    You are my hero!
    I ran into this problem on a server 2012 R2, basically because it is used as a hyper-v host and suddenly veeam backups from VMs on this host stopped working (they failed with an RPC error). RDP session from the server to other servers and internet connection did not work either (though everything was set up correctly).
    It took me some time to find the warning with ID 4231 in the eventlog which brought my to your blog – thank you very much for sharing this!

    Regards,
    Michael

Leave a Reply

Your email address will not be published. Required fields are marked *