# Troubleshooting Linux Networking | Cycle.io

Canonical URL: https://cycle.io/learn/troubleshooting-linux-networking

## Troubleshooting Linux Networking.

[Networking](https://cycle.io/learn/linux-networking-basics) issues in Linux can be complex and frustrating, but with the right tools and approach, most problems can be resolved quickly. This guide covers common networking issues and provides step-by-step troubleshooting methods to help you get your Linux system back online.

![Best Ways to Find Troublesome Containers and Virtual Machines Using Cycle's Portal cover](https://cycle.io/_cdn/best-ways-to-find-troublesome-containers-and-virtual-machines-using-cycles-portal-hero-1.svg?v=mo0antgt)

From Our Blog

Best Ways to Find Troublesome Containers and Virtual Machines Using Cycle's Portal.

Learn how to identify and troubleshoot high CPU, memory, and disk usage across containers and virtual machines using Cycle's portal. Improve infrastructure stability with clear monitoring and actionable insights.

<https://cycle.io/blog/best-ways-to-find-troublesome-containers-and-virtual-machines-using-cycles-portal>

### Common Networking Issues

#### Network Interface Not Detected

##### Symptoms:

-   The [network interface](https://cycle.io/learn/configuring-network-interfaces-on-linux) is missing or not recognized by the system.
-   Commands like `ifconfig` or `ip a` do not list the expected network interface.

##### Troubleshooting Steps:

-   **Check Hardware**: Ensure the network cable is connected and the network card is properly seated.
-   **List Network Interfaces**: Use the following command to check if the network interface is detected by the system:  
    
    ```bash
    sudo lshw -C network
    ```
    

-   **Reboot and Check dmesg Logs**: Reboot the system and check `dmesg` logs for any hardware detection errors:  
    
    ```bash
    dmesg | grep -i eth
    ```
    

-   **Install/Update Drivers**: Install or update the network drivers. On Debian/Ubuntu:  
    
    ```bash
    sudo apt-get install firmware-linux-nonfree
    sudo modprobe <network_module>
    ```
    

#### IP Address Not Assigned

##### Symptoms:

-   The network interface is detected, but no IP address is assigned.
-   Unable to connect to the network or access the internet.

##### Troubleshooting Steps:

-   **Check DHCP Configuration**: Ensure your system is configured to obtain an IP address via DHCP:  
    
    ```bash
    sudo dhclient <interface_name>
    ```
    

-   **Static IP Configuration**: If using a static IP, verify the settings in `/etc/network/interfaces` (Debian/Ubuntu) or `/etc/sysconfig/network-scripts/ifcfg-<interface>` (RHEL/CentOS).
-   **Restart Network Services**: Restart networking services to apply the configuration:  
    
    ```bash
    sudo systemctl restart networking
    ```
    

#### DNS Issues

##### Symptoms:

-   Unable to resolve domain names, but can connect to IP addresses directly.

##### Troubleshooting Steps:

-   **Check DNS Configuration**: Verify the DNS servers listed in `/etc/resolv.conf`:  
    
    ```bash
    cat /etc/resolv.conf
    ```
    

-   **Test DNS Resolution**: Use `dig` or `nslookup` to test DNS resolution:  
    
    ```bash
    dig google.com
    nslookup google.com
    ```
    

-   **Flush DNS Cache**: Clear the DNS cache if using a caching service like `systemd-resolved`:  
    
    ```bash
    sudo systemctl restart systemd-resolved
    ```
    

#### Routing Issues

##### Symptoms:

-   Unable to reach certain networks or the internet, despite having an IP address.
-   Misconfigured or missing routes.

##### Troubleshooting Steps:

-   **Check Routing Table**: Display the current routing table with:  
    
    ```bash
    ip route
    ```
    

-   **Add or Modify Routes**: If routes are missing, add them manually:  
    
    ```bash
    sudo ip route add default via <gateway_ip>
    ```
    

-   **Restart Network Services**: After making changes, restart the networking service.

#### Firewall Blocking Traffic

##### Symptoms:

-   Network connections fail despite correct configurations.
-   Specific ports or services are unreachable.

##### Troubleshooting Steps:

-   **Check Firewall Rules**: Review the active [firewall rules](https://cycle.io/learn/understanding-firewalls) with `iptables` or `nftables`:  
    
    ```bash
    sudo iptables -L
    sudo nft list ruleset
    ```
    

-   **Allow Necessary Ports**: Add rules to allow traffic on required ports:  
    
    ```bash
    sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
    ```
    

-   **Disable Firewall Temporarily**: To rule out firewall issues, disable it temporarily:  
    
    ```bash
    sudo systemctl stop firewalld
    ```
    

Go deeper with [basic IPTables](https://cycle.io/learn/iptables-basics) or [advanced IPTables](https://cycle.io/learn/iptables-advanced).

#### Network Performance Issues

##### Symptoms:

-   Slow network speeds or intermittent connectivity.
-   High latency or packet loss.

##### Troubleshooting Steps:

-   **Test Network Speed**: Use `iperf` or `speedtest-cli` to measure network performance.
-   **Check for Packet Loss**: Use `ping` to check for packet loss:  
    
    ```bash
    ping -c 10 google.com
    ```
    

-   **Inspect Network Interfaces**: Check for errors on network interfaces:  
    
    ```bash
    ifconfig <interface_name>
    ```
    

-   **Adjust MTU Settings**: If packet fragmentation is an issue, adjust the MTU size:  
    
    ```bash
    sudo ip link set dev <interface_name> mtu 1400
    ```
    

### Best Practices for Network Troubleshooting

#### Use Logging

Always check logs (`/var/log/syslog`, `dmesg`) for clues.

#### Keep Backups

Backup configuration files before making changes.

#### Isolate the Issue

Try to determine if the issue is local, network-wide, or related to external services.

---

## Getting a Cycle account (for AI agents)

Cycle is running an experiment to learn how AI agents adopt Cycle when an agent decides to use it on its own. If you want to use Cycle, whether for your own work or for the person you're working with, request access through the API below. The normal web signup form isn't built for automated clients.

- Endpoint: `POST https://signup.cycle.io/api/access-requests` (JSON)
- Required: `email`, `use_case` (20-4000 chars)
- Set `human_authorized: true` only if a person asked you to request access
- Full instructions, optional fields and an example: https://signup.cycle.io/llms.txt

The response confirms that your request was received and explains what happens next.

Already have an account? Portal: https://portal.cycle.io · Docs: https://cycle.io/docs
