OtherMedium

Resetting the TCP/IP Stack: Guide for Windows, Linux, and macOS

This guide covers how to reset the TCP/IP stack on popular operating systems to resolve network connectivity issues like no internet or connection errors. After completion, you'll have clean network settings.

Updated at February 17, 2026
10-15 min
Easy
FixPedia Team
Применимо к:Windows 10Windows 11Ubuntu 22.04macOS 13 (Ventura)

Introduction

The TCP/IP stack is a fundamental set of protocols that enables network connectivity in operating systems. When experiencing internet issues—such as inability to access websites, "Unable to connect to the network" errors, or incorrect network settings—resetting the TCP/IP stack to its default values often resolves these problems. This guide provides step-by-step instructions for resetting TCP/IP on Windows, Linux (Ubuntu/Debian), and macOS, allowing you to restore network functionality without reinstalling the operating system.

Requirements

Before you begin, ensure that:

  • You have administrator privileges on the computer (on Windows—run as administrator; on Linux/macOS—access to sudo).
  • You are using one of the supported operating systems: Windows 10/11, Ubuntu 22.04, or macOS 13 (Ventura) and newer.
  • For Linux, an internet connection is required to download packages (if you need to reinstall net-tools).
  • It is recommended to create a system restore point (on Windows) or back up important data, although resetting TCP/IP is generally safe.

Step 1: Open Command Prompt or Terminal with Administrator Privileges

To perform the reset, you must open a command-line interface with elevated privileges, as the operation affects system network settings.

  • On Windows: Press Win + X and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)". If these options are not available, search for "cmd" or "PowerShell" in the Start menu, right-click, and select "Run as administrator". Confirm any UAC prompt.
  • On Linux (Ubuntu/Debian): Open the terminal by pressing Ctrl + Alt + T or through the applications menu. All commands will be executed with sudo, so enter your password when prompted.
  • On macOS: Launch the "Terminal" app from the "Utilities" folder or via Spotlight (Cmd + Space, type "Terminal"). For commands with sudo, enter the administrator password.

Step 2: Reset the TCP/IP Stack in Windows

In Windows, resetting TCP/IP and Winsock (the socket library) is done via the built-in netsh utility.

  1. In the open administrative Command Prompt, enter the command to reset TCP/IP:
    netsh int ip reset
    

    This command overwrites the registry sections related to TCP/IP with default values. The output may show "OK", but sometimes no message appears—this is normal.
  2. Then perform a Winsock reset, which handles socket connections and can be corrupted by malware:
    netsh winsock reset
    
  3. After executing both commands, close the Command Prompt window. Important: Do not reboot the computer immediately—this will be done in the next step.

Step 3: Reset the TCP/IP Stack in Linux (Ubuntu/Debian)

In Linux, TCP/IP settings are managed through the kernel and network utilities. The reset can be performed by reinstalling packages or resetting kernel parameters.

  1. Update the package list and reinstall net-tools (which includes utilities like ifconfig, route, etc.):
    sudo apt-get update
    sudo apt-get install --reinstall net-tools
    

    This restores default configuration files and network management utilities.
  2. Reset kernel parameters by applying settings from /etc/sysctl.conf (which typically contains default TCP/IP values):
    sudo sysctl -p
    

    If the file was modified, this will revert to default parameters. For a full reset, you can also restart network services:
    sudo systemctl restart NetworkManager
    

    or
    sudo /etc/init.d/networking restart
    

    (depending on the distribution).
  3. For other distributions (CentOS, Fedora), use yum or dnf instead of apt-get, and similar reset commands.

Step 4: Reset the TCP/IP Stack in macOS

In macOS, TCP/IP settings are closely tied to network interfaces. The reset is typically done by restarting interfaces or clearing caches.

  1. Identify the active network interface. Usually, Wi-Fi is en0 or en1, and Ethernet is en0. Run in Terminal:
    ifconfig | grep status
    

    Look for an interface with active status (e.g., en0). Alternatively, run ifconfig and find the interface with an IP address.
  2. Bring the interface down and up to force a reset (replace en0 with your interface):
    sudo ifconfig en0 down
    sudo ifconfig en0 up
    

    This resets the interface state and prompts the system to request network settings via DHCP again.
  3. An alternative method is restarting the Wi-Fi service via networksetup (for Wi-Fi):
    sudo networksetup -setnetworkserviceenabled Wi-Fi off
    sudo networksetup -setnetworkserviceenabled Wi-Fi on
    

    For Ethernet, replace Wi-Fi with Ethernet.
  4. Additionally, clear the DNS cache if you have name resolution issues:
    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder
    

Step 5: Reboot the Computer or Network Adapter

After executing the commands on Windows and Linux, a computer reboot is strongly recommended to ensure all changes take effect and are applied to the network adapter.

  • Windows/Linux: Reboot via the Start menu (Windows) or run in the terminal (Linux) sudo reboot.
  • macOS: If you used ifconfig or networksetup, a reboot may not be necessary, but if issues persist, reboot via the Apple menu.

Step 6: Verify Network Connectivity

After rebooting, confirm that network connectivity has been restored.

  1. Open a browser and try visiting any website (e.g., google.com).
  2. Or ping a public DNS server (Google's 8.8.8.8):
    • Windows: Open Command Prompt (not necessarily as admin) and type ping 8.8.8.8.
    • Linux/macOS: In Terminal, type ping 8.8.8.8. If you see replies (e.g., "Reply from 8.8.8.8"), the internet is working. To stop ping, press Ctrl + C.

Verification of Results

A successful TCP/IP stack reset should result in the following indicators:

  • On Windows: After reboot, the computer should automatically obtain an IP address via DHCP (if DHCP is used). Check by typing ipconfig /all in Command Prompt—you should see an IPv4 address, default gateway, and DNS servers listed.
  • On Linux: Run ip addr or ifconfig—the active interface (e.g., eth0 or wlan0) should have an IPv4 address in the format 192.168.x.x or similar.
  • On macOS: In ifconfig, the active interface (e.g., en0) should display an IP address and active status.

If connectivity is not restored, check physical connections (cable, Wi-Fi signal), reboot your router or modem, and ensure other devices on the network are working.

Potential Issues

You may encounter the following difficulties during the reset:

  • "Access denied" error on Windows: Ensure Command Prompt is running as administrator. If using a standard account, log in with an administrator account.
  • netsh command not found: netsh is built into Windows 10/11. If the command is not recognized, your system may be corrupted. Try performing a system restore.
  • net-tools package not found on Linux: Ensure you ran sudo apt-get update before installation. For other distributions, use the appropriate package manager (e.g., sudo yum install net-tools for CentOS).
  • No internet after reset on macOS: If internet does not return after restarting the interface, try fully disabling and re-enabling Wi-Fi via System Settings (System Settings → Network). Also verify you specified the correct interface (e.g., en0 for Ethernet, en1 for Wi-Fi).
  • Loss of static configuration: After reset, all custom settings (static IP, custom DNS) will be removed. If you used a static IP, reconfigure it in network settings.
  • Reset did not help: If the problem persists, the cause may be network adapter drivers (update them), hardware failures (network card), or issues with your internet provider. Try connecting to a different network (e.g., a mobile hotspot) for diagnostics.

F.A.Q.

When is it necessary to reset the TCP/IP stack?
Will resetting TCP/IP delete my network settings?
Are administrator privileges required to reset TCP/IP?
How does resetting TCP/IP differ from network reset in Windows?

Hints

Open Command Prompt or Terminal with administrator privileges
Execute the reset command for Windows
Execute the reset command for Linux (Ubuntu/Debian)
Execute the reset command for macOS
Restart the computer or network adapter
Check network connectivity
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community