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.

3 Responses 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

  2. gary says:

    I am not an IT guy, so explain in detail please. I have event 4231 and lose my internet daily, though everything says it is connected. I have a stand alone PC running Win 10 latest release. I am able to navigate to the 2 listed reg keys, but I do not have the final sub key values. If I did I could change them. I have no idea HOW to add them.
    Please email me at ****@gmail.com
    thanks
    gary
    ——————-
    G.Born: e-mail due to data protection & privacy rules deleted.

    Sorry, I'm not in the position to give individual support. Contact Microsoft's Windows support or post your query at Microsofts Answers-Forum. Thx

  3. gary says:

    This seems to have fixed my problem. Got help making the registry changes, but it worked!!

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
    "TcpTimedWaitDelay"=dword:0000001e
    "MaxUserPort"=dword:0000fffe
    "TcpNumConnections"=dword:00fffffe
    "TcpMaxDataRetransmissions"=dword:00000005
    • TcpTimedWaitDelay – 30
    • MaxUserPort – 65534
    • TcpNumConnections – should be in default state stretched to maximum = 16777214 should prevent server from exhausting ephemeral ports.
    • TcpMaxDataRetransmissions – Timeout limit of TCP unacknowledged data segments retransmission on actual connection = 5.

Leave a Reply

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

Note: Please note the rules for commenting on the blog (first comments and linked posts end up in moderation, I release them every few hours, I rigorously delete SEO posts/SPAM).