Can't access internet after disconnecting AnyConnect VPN on Fedora

Abstract: Fixes Fedora internet loss after disconnecting AnyConnect by manually restoring the default gateway or configuring NetworkManager split tunneling.

Created: 2026-07-31 by

Internet access fails on Fedora after disconnecting Cisco AnyConnect because the VPN client modifies the default routing table and does not always restore it correctly. The solution involves manually restoring the original gateway or using NetworkManager’s built-in split-tunneling features to prevent persistent route conflicts.

Understanding the Routing Table Conflict

When you connect to a Cisco AnyConnect VPN, the client typically adds specific routes for corporate networks and often changes your default gateway to point through the virtual adapter. This ensures all traffic flows through the secure tunnel. However, upon disconnection, the operating system should revert these settings. On Fedora, especially with newer versions of NetworkManager, this rollback process can fail due to race conditions or improper cleanup of the routing rules. The primary symptom is that packets intended for the public internet are either dropped or routed incorrectly because the system still believes the VPN interface is the primary path. You may also notice that local network resources become inaccessible if the VPN removed your local subnet routes. This behavior is distinct from DNS issues, where you can ping IP addresses but cannot resolve domain names. If you suspect a similar issue in other environments, such as WSL2, you might find relevant context in our guide on WSL2 unable to connect to IP address (not DNS) on Cisco Anyconnect VPN, although the underlying mechanism differs slightly between Linux and Windows subsystems. To diagnose this, open a terminal and run ip route show. Look at the line starting with default. If it points to an IP address associated with your VPN interface (often named something like tun0 or anyconnect) rather than your physical network interface (like eth0 or wlan0), the rollback has failed.

Identifying Your Network Interfaces

Before making changes, identify your active physical interface. Use the command ip link show or nmcli device status. Physical interfaces usually have names like enp3s0, wlp2s0, or eth0. The VPN interface will be virtual. Do not assume the interface name is dco0 or any other specific identifier; always verify it dynamically.

Restoring the Default Gateway Manually

If the automatic restoration fails, you must manually correct the routing table. This requires knowing the IP address of your router or gateway on the local network. You can usually find this by checking your connection details in the NetworkManager applet or by running ip route show | grep default while connected to Wi-Fi or Ethernet without the VPN active. Once you have the gateway IP, execute the following steps to reset the routing table. Replace <gateway_ip> with your actual router IP and <interface_name> with your physical interface.
sudo ip route del default
sudo ip route add default via  dev 
This command removes the lingering default route pointing to the VPN and establishes a new one pointing to your local router. After executing this, test your internet connectivity by pinging an external server like 8.8.8.8. If the ping succeeds, the routing issue is resolved. Note that you may need to flush the DNS cache if you still experience resolution errors, which can be done by restarting the systemd-resolved service with sudo systemctl restart systemd-resolved.

Configuring Split Tunneling in NetworkManager

A more robust long-term solution is to configure NetworkManager to handle the VPN connection differently, preventing it from hijacking the default route entirely. This is known as split tunneling. Instead of sending all traffic through the VPN, only traffic destined for corporate subnets goes through the tunnel, while general internet traffic remains on your local network. To enable this, you need to edit the connection profile for your AnyConnect VPN. First, list your connections using nmcli connection show. Identify the name of your VPN connection. Then, modify the IPv4 settings to disable "Use this network connection only for resources on its network" or ensure that the "Default Route" option is unchecked. In the graphical NetworkManager applet, go to the VPN connection settings, navigate to the IPv4 tab, and look for the routing options. Ensure that "Automatic" is selected for the method, but uncheck the box labeled "Use this connection only for resources on its network." This forces NetworkManager to keep the local default route intact even when the VPN is active. When you disconnect, there is no conflicting route to remove, eliminating the post-disconnection internet outage.

Verifying the Configuration

After changing the settings, reconnect to the VPN. Run ip route show again. You should see specific routes for your corporate network pointing to the VPN interface, but the default route should still point to your local gateway. This confirms that split tunneling is working correctly. If you encounter issues with internal resource access, refer to troubleshooting guides for specific protocols, though standard TCP/IP routing should remain stable. For users dealing with different VPN technologies like WireGuard, the principles of route management are similar, as seen in discussions about Troubleshooting WireGuard Client-to-Client Communication Issues.

Preventing Future Conflicts with Firewall Rules

Sometimes, firewall configurations persist even after the VPN disconnects. While generic firewall advice is rarely the root cause of routing failures, it is worth ensuring that your firewall is not blocking traffic on the loopback or virtual interfaces. On Fedora, firewalld is the default tool. You can check the status with sudo firewall-cmd --state. If you suspect firewall interference, you can temporarily stop the firewall to test connectivity: sudo systemctl stop firewalld. If internet access returns, the issue lies within firewall zones or services. However, do not leave the firewall disabled. Instead, review the zones assigned to your network interfaces. Ensure that your primary interface is in the public or home zone, which allows established connections. Avoid adding custom rules that explicitly block or redirect traffic based on interface names unless absolutely necessary. Automating these fixes with cron jobs is bad practice because network states change dynamically; manual intervention or proper configuration of NetworkManager profiles is the correct approach.

Frequently Asked Questions

Why does my DNS work but I have no internet?

This indicates that your routing table is likely correct, but there is a deeper packet filtering issue. Check if your firewall is blocking outbound traffic on port 443 or 80. Also, verify that your DNS resolver is reachable by pinging its IP address directly.

How do I find my current default gateway?

Run the command ip route show | grep default in your terminal. The output will show the IP address of the gateway that handles your internet traffic. It is listed next to the word "via".

Can I use Netplan to fix this issue?

No, Netplan is primarily used for configuring network interfaces on Ubuntu Server and cloud instances. Fedora uses NetworkManager by default, so you should manage your VPN settings through NMCLI or the graphical applet instead.

What if the VPN interface disappears completely?

If the interface vanishes, the kernel module may have crashed. Restarting the NetworkManager service with sudo systemctl restart NetworkManager will reload the network stack and reinitialize all interfaces, including the VPN adapter.

Is it safe to delete the default route manually?

Yes, it is safe provided you immediately replace it with the correct local gateway. Deleting it without adding a new one will result in a complete loss of internet connectivity until a new default route is established.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More