Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
FREEDOM251

Freedom251 › Blog › IPv6

How to Disable IPv6 Temporarily on Linux and Restore It Safely

By Freedom251 Team · · 12 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a short Linux troubleshooting test, use the runtime sysctl control rather than a boot-time module parameter:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

When the test is finished, restore IPv6 immediately with:

As an Amazon Associate I earn from qualifying purchases.

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0

The value 1 disables IPv6 on all interfaces and 0 enables it. This changes the live kernel networking state: IPv6 addresses and routes are removed while it is disabled, so active IPv6 connections stop working. Use the procedure below when you need a reversible test, not as a permanent system policy.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What this temporary change actually does

Disabling IPv6 with this sysctl is an operational networking change, not a cosmetic change to command output. The Linux kernel removes IPv6 addresses and routes from affected interfaces when the value changes from 0 to 1. Applications that require IPv6 can therefore fail immediately, and existing IPv6 sessions can be interrupted. IPv4 is not disabled by this setting, so programs with a working IPv4 fallback may continue normally.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

The reverse operation is also active. Changing the value back to 0 re-enables IPv6, dynamically creates a link-local address when needed and starts Duplicate Address Detection (DAD). That restores the protocol, but it does not promise that every former global address or route will return instantly. Router advertisements, DHCPv6, static settings and the local network manager determine the rest of the address configuration.

Check the current IPv6 setting first

Before changing anything, record the current global value:

sysctl net.ipv6.conf.all.disable_ipv6

A typical enabled result is:

net.ipv6.conf.all.disable_ipv6 = 0

A result ending in 1 means the global setting is already disabled. Keep this output in your notes so you know what state the system had before the test. If the machine is managed by another administrator or a configuration-management system, also note that such a service may reapply its own policy later.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before you disable IPv6

  • Define the scope. Decide which application, route or failure you are isolating and what result would show that IPv6 was involved.
  • Plan an access path. If you are connected over IPv6, disabling it can terminate your remote session. Use console access, an IPv4 management path or an out-of-band channel when possible.
  • Record dependencies. Note services, monitoring endpoints and users that may have IPv6-only connectivity. A test on a production host should be announced before the change.
  • Capture the starting state. Save the sysctl result and any important IPv6 addresses, routes or service status so you can compare recovery afterward.
  • Keep the test short. The longer IPv6 remains disabled, the more likely applications, health checks and sessions are to fail or time out.

No package or special hardware is required. The procedure uses the kernel’s existing sysctl interface and ordinary system configuration files.

Disable IPv6 for a temporary runtime test

Apply the live kernel change

  1. Open a terminal account that can use sudo.
  2. Run:
    sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
  3. Enter your password if prompted. A successful write normally echoes the parameter and its new value:
    net.ipv6.conf.all.disable_ipv6 = 1

This is an immediate runtime write. It does not edit a configuration file and does not, by itself, create a setting that will be reapplied at the next boot.

Understand what changes on the interfaces

The kernel treats net.ipv6.conf.all.disable_ipv6 as the all-interface IPv6 control. Changing it from 0 to 1 dynamically deletes IPv6 addresses and routes from the affected interfaces. IPv6 is therefore unavailable for applications, services and routes that depend on it; this is more than hiding addresses from a display command.

Because addresses and routes are deleted, do not expect an existing IPv6 connection to survive the transition. A dual-stack application may reconnect over IPv4, while an IPv6-only service will remain unreachable until IPv6 is restored and the required addresses and routes are configured again.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Verify the value after changing it

Read the setting again:

sysctl net.ipv6.conf.all.disable_ipv6

It should report 1. If a test depends on a particular interface, also check that interface through your normal Linux networking tools and confirm that the expected IPv6 connectivity has stopped. The sysctl value is the authoritative check for the global kernel switch, while interface and application checks show the practical effect of the change.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Run and document the diagnostic

Perform only the test you intended: retry the failing connection, compare name-resolution behavior, exercise the route or reproduce the service error. Record whether the application used IPv4 after IPv6 was removed. A successful request does not prove that IPv6 was irrelevant; the application may simply have fallen back to IPv4 or used a cached connection.

Keep the diagnostic result separate from the configuration change. Write down the time of disablement, the command output, the test result and the time of restoration. This makes it easier to distinguish a networking symptom from a later address-configuration delay.

Restore IPv6 immediately after the test

Write the enabled value

Run:

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0

Confirm the result:

sysctl net.ipv6.conf.all.disable_ipv6

The expected output is:

net.ipv6.conf.all.disable_ipv6 = 0

Allow address configuration to complete

When the value changes from 1 to 0, Linux dynamically creates a link-local IPv6 address and starts Duplicate Address Detection when needed. That brings IPv6 functionality back, but it does not guarantee that every former global address or route instantly reappears. Global addressing depends on router advertisements, DHCPv6, static configuration and the network manager in use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

After restoring the setting, give the interface a moment to receive its normal network configuration. If a global address or route is still missing, investigate the local network configuration instead of repeatedly toggling the sysctl. Repeated toggling can create more connection interruptions without fixing a missing advertisement, DHCPv6 lease or static setting.

Verify recovery in layers

  1. Confirm the global sysctl reads 0.
  2. Check that the interface has regained its expected link-local address after DAD.
  3. Check for the expected global address and IPv6 route.
  4. Retry the application or service that prompted the test.
  5. Inspect logs or normal network-manager status if the address or route remains absent.

A link-local address returning proves that IPv6 was re-enabled at the kernel level; it does not by itself prove that the host has restored global IPv6 connectivity.

Runtime disable versus persistent configuration

These methods have different lifetimes and recovery procedures. Choose the runtime command for a temporary experiment; use a file under /etc/sysctl.d/ only when you intentionally want a lasting policy.

Method When it applies How to restore IPv6 Main consequence
Runtime sysctl Immediately, while the current kernel is running Run sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 Suitable for a reversible test; the write alone is not a boot-time setting
sysctl.d configuration At boot through systemd-sysctl, and as interfaces appear when applicable Remove or revise the file, then allow the sysctl configuration to be applied Creates a persistent system policy
IPv6 module parameter disable=1 When the IPv6 module is loaded Re-enable IPv6 with a reboot Too disruptive for a test that must be reversed immediately

Why a runtime write does not normally persist

sysctl -w changes the live kernel parameter in memory. Unless another configuration mechanism writes the value again, a reboot starts with the distribution’s normal defaults. However, a reboot will not necessarily restore IPv6 if an administrator, package or network-management component has already installed a persistent setting. Inspect local configuration before assuming that restarting the machine will undo the change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a sysctl.d file is appropriate

If disabling IPv6 is an intentional long-term policy, create a configuration file in /etc/sysctl.d/ with this line:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
net.ipv6.conf.all.disable_ipv6 = 1

Use your preferred root-capable editor, for example:

sudo editor /etc/sysctl.d/99-disable-ipv6.conf

Save the line, then let the system’s sysctl service apply the configuration according to the distribution’s boot process. To return to the normal policy, remove that line or delete the file, then apply the revised configuration and reboot if necessary. Do not create this file merely to run a short diagnostic; it changes future boots as well as the current policy once applied.

Persistent configuration also changes the recovery procedure. Setting the live value to 0 can restore IPv6 for the current session, but the next boot may disable it again if the file remains. Conversely, deleting a file does not necessarily change the current kernel value until the revised configuration is applied or the machine is restarted.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Interface arrival and module timing

systemd-sysctl reads sysctl.d files at boot, and network-interface-specific settings can also be applied as interfaces appear. Some kernel parameters do not exist until a module loads. In that situation, a boot-time sysctl entry may be too early to apply. The sysctl.d documentation recommends arranging for the module to load before the sysctl service or using a udev rule that applies the setting when the module appears.

Distribution-specific network managers may also set IPv6 policy. If the value changes back after boot, link activation or a service restart, inspect those local configuration layers rather than assuming the kernel ignored the command. The exact order and files vary by distribution, so do not claim that a single sysctl entry overrides every userspace network manager.

Why the module parameter is the wrong choice for a short test

Linux also documents an IPv6 module parameter named disable. Setting it to 1 disables IPv6 functionality at module-load time. The kernel documentation describes this parameter as specifying whether to disable IPv6 on all interfaces and states that a reboot is required to enable IPv6 again.

That recovery requirement makes the module parameter unsuitable when you need to turn IPv6 off and back on during one troubleshooting session. It may be appropriate only for a deliberate boot-time policy where a reboot is acceptable. For a short test, the runtime net.ipv6.conf.all.disable_ipv6 control is the reversible option.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A safe troubleshooting workflow

  1. Define the test. Decide which application, route or failure you are isolating and how you will know whether IPv6 was involved.
  2. Record the starting state. Run sysctl net.ipv6.conf.all.disable_ipv6 and save the output. Note any important IPv6 addresses, routes or service dependencies before changing the network.
  3. Protect access. Ensure you have console or IPv4 access if the host is managed remotely over IPv6.
  4. Warn affected users and services. Existing IPv6 sessions and services that have no IPv4 alternative can fail as soon as the addresses and routes disappear.
  5. Apply the runtime value. Use sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1. Do not edit a sysctl.d file unless persistence is part of the test.
  6. Run the diagnostic. Test the application or route while IPv6 is disabled, and record the result separately from the setting change.
  7. Restore the kernel setting. Run sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0 as soon as the test is complete.
  8. Verify recovery. Read the sysctl value, then check that the interface receives the IPv6 configuration supplied by your network. Allow time for Duplicate Address Detection and other normal address-configuration steps.
  9. Remove accidental persistence. If you created or discovered a sysctl.d entry for the test, remove or revise it so the next boot follows the intended policy.

Troubleshooting common problems

sysctl: permission denied or an equivalent error

The write requires administrator privileges. Prefix the write itself with sudo:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1

Running sudo on a separate shell command does not elevate later commands, so ensure the command that writes the parameter is the one receiving administrative authorization.

The value changes, but IPv6 traffic still appears to work

Check the value again with sysctl net.ipv6.conf.all.disable_ipv6 and identify which path the test is using. An application may have fallen back to IPv4, used a cached connection, or reached a component that is not dependent on IPv6. The setting controls IPv6 on all interfaces; it does not disable IPv4 or prove that a particular application selected IPv6.

The value returns to its previous state

A userspace network manager, boot-time sysctl configuration or another administrator action may be rewriting the parameter. Search the local /etc/sysctl.d/ files and distribution configuration, and check which service runs when interfaces are activated. The kernel runtime write is immediate, but it does not override every later policy change made by userspace.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

IPv6 does not fully return after writing 0

First confirm that the global value is 0. Linux should create a link-local address and begin Duplicate Address Detection when necessary. A global address or route still depends on the network’s advertisements, DHCPv6 or static settings. Check the interface’s normal network configuration and logs, and verify that no persistent policy is disabling IPv6 again.

A reboot did not restore IPv6

Look for a line such as net.ipv6.conf.all.disable_ipv6 = 1 in /etc/sysctl.d/ and other sysctl configuration locations used by the distribution. Also check whether IPv6 was disabled with the module parameter or whether a network manager applies its own policy. A runtime sysctl -w is temporary only when no other persistent mechanism repeats it at boot.

A boot-time sysctl entry has no effect

The parameter may not exist when systemd-sysctl processes the file, particularly when the relevant kernel module loads later. Arrange for the module to load earlier or use a udev rule to apply the setting when the module appears, as recommended by the sysctl.d documentation. Interface-specific timing can also matter when a device is created after the initial boot pass.

Remote access stopped unexpectedly

If your management connection used IPv6, deleting the address and route can terminate it without giving the application time to reconnect. Use the console or an IPv4 path to run the restore command. Once the value is set to 0, wait for link-local and global configuration to return before assuming the host is fully reachable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Commands at a glance

  • Read the current global state: sysctl net.ipv6.conf.all.disable_ipv6
  • Disable IPv6 now: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
  • Enable IPv6 now: sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0
  • Persistent policy file: /etc/sysctl.d/*.conf, applied by systemd-sysctl during the system’s configuration process

For a one-time test, the two runtime commands are the safest path: read the value, write 1, perform the diagnostic, write 0, and then verify that the network has rebuilt the IPv6 configuration it receives from its environment.

Frequently Asked Questions

Will sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 survive a reboot?

No. It changes the live kernel value only. It will be repeated at boot only if a persistent sysctl configuration, module setting or network-management component applies it again.

How do I re-enable IPv6 without rebooting?

Run sudo sysctl -w net.ipv6.conf.all.disable_ipv6=0. Linux will recreate link-local addressing and start Duplicate Address Detection when needed; global addresses and routes may take additional time to return.

Does disabling IPv6 also disable IPv4?

No. This control affects IPv6. Applications may continue to work over IPv4, which is why a successful connection does not necessarily mean the test had no IPv6 effect.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why did my IPv6 address disappear?

That is expected when the value changes to 1: the kernel dynamically deletes IPv6 addresses and routes from affected interfaces. They can be configured again only after IPv6 is enabled.

Why is IPv6 still disabled after a reboot?

Check /etc/sysctl.d/ and other distribution sysctl locations for a persistent setting, then check module parameters and network-manager policy. A runtime write is temporary only when no other mechanism reapplies it.

Is the IPv6 module parameter suitable for a quick diagnostic?

Usually not. The module parameter disable=1 disables IPv6 at module-load time, and the kernel documentation says a reboot is required to enable it again. Use the runtime sysctl for an immediate rollback.

What if the sysctl value is zero but no global IPv6 address returns?

The kernel may already have restored a link-local address while the network is still waiting for router advertisements, DHCPv6 or static configuration. Check normal interface and network-manager status rather than repeatedly changing the sysctl.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can a network manager override my runtime command?

Yes. Userspace services can rewrite policy during boot, interface activation or service restart. If the value changes back, inspect local sysctl files and the distribution’s network-management configuration.

The Bottom Line

For a reversible Linux IPv6 test, read net.ipv6.conf.all.disable_ipv6, set it to 1, run the diagnostic, then set it to 0. Expect IPv6 addresses and routes to disappear during the test and allow time for link-local, DAD and network-provided global configuration to return. Keep persistent sysctl.d files and the reboot-required module parameter out of a short-lived experiment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

IPv6LinuxnetworkingsysctlTroubleshooting

Leave a Reply

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

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.