Lost connection to IPv4 network via ethernet

This means aur packages do not get upgraded. This is only one box, so the network is well for other computers.
The ip a command gives this:

inet 192.168.1.13/24 metric 1024 brd 192.168.1.255 scope global dynamic enp2s0
   valid_lft 74889sec preferred_lft 74889sec

where the metric 1024 is different from the other computers.
The routing is strange, route -FC gives this:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
one.one.one.one 192.168.1.1 255.255.255.255 UGH 1024 0 0 enp2s0
dns.google 192.168.1.1 255.255.255.255 UGH 1024 0 0 enp2s0
192.168.1.1 0.0.0.0 255.255.255.255 UH 1024 0 0 enp2s0
Kernel IP routing cache
Source Destination Gateway Flags Metric Ref Use Iface

I have configured long time ago a systemd network
/etc/systemd/network/10-enp2s0.network

with this content:

[Match]
Name=enp2s0

[Network]
DHCP=yes

I cannot ping this ip address from other boxes and vice versa - network is unreachable this box says.

I don’t really understand what’s going on anymore. Is ther a simple way to reset this?

Hi @slim ,

I’m not sure if you’ll get an answer to this issue on the Mabox forum.

So I’ll share a ChatGPT-generated response based on your question, along with my personal perspective.

Personally, I don’t fully understand the systemd setup for auto DHCP.
I believe NetworkManager handles that, and its default setting is auto DHCP.
(See the AI-generated answer below.)

ANSWER AI following your question with systemd.

It looks like your system is not correctly handling its network configuration,
likely due to an issue with systemd-networkd or a misconfigured route.
Here are a few solutions to reset and fix the issue:


Solution 1: Restart systemd-networkd and Reapply Configuration

  1. Ensure systemd-networkd is enabled and running:

    sudo systemctl restart systemd-networkd
    sudo systemctl restart systemd-resolved
    
  2. Check if it’s running properly:

    systemctl status systemd-networkd
    systemctl status systemd-resolved
    
  3. Flush old routes and addresses:

    sudo ip addr flush dev enp2s0
    sudo ip route flush table main
    sudo systemctl restart systemd-networkd
    

Solution 2: Manually Set a Static Metric (Lower than 1024)

The metric 1024 on enp2s0 might be causing routing issues. Try setting a lower metric:

  1. Modify your network configuration file /etc/systemd/network/10-enp2s0.network:

    [Match]
    Name=enp2s0
    
    [Network]
    DHCP=yes
    RouteMetric=100
    
  2. Restart networking:

    sudo systemctl restart systemd-networkd
    

Solution 3: Ensure Proper Gateway Configuration

From your route -FC output, it seems like your default gateway is missing. You may need to add it manually:

sudo ip route add default via 192.168.1.1 dev enp2s0

To make this permanent, update your network config:

[Network]
DHCP=yes
Gateway=192.168.1.1

Restart networking:

sudo systemctl restart systemd-networkd

Solution 4: Check systemd-networkd Lease

If using DHCP, check your current lease:

sudo journalctl -u systemd-networkd --no-pager | grep DHCP

If it looks incorrect, you can clear and renew the lease:

sudo rm /var/lib/systemd/networks/*
sudo systemctl restart systemd-networkd

Solution 5: Disable Conflicting Services

Ensure NetworkManager or other networking tools are not interfering with systemd-networkd:

sudo systemctl disable --now NetworkManager

Then restart systemd-networkd:

sudo systemctl restart systemd-networkd

Solution 6: Full Network Reset

If none of the above work, you can fully reset network settings:

sudo systemctl stop systemd-networkd
sudo rm -rf /etc/systemd/network/*
sudo rm -rf /var/lib/systemd/networks/*
sudo systemctl restart systemd-networkd

Then recreate /etc/systemd/network/10-enp2s0.network and restart.

After these steps, test connectivity with PING:


NETWORKMANGER (explained)

Question: *User uses manjaro openbox with networkmanager. *
Is it true networkmanager is set to auto dhcp as default so no need for systemd file.

Answer: Yes, that’s correct! NetworkManager is set to use DHCP automatically by default, so you don’t need a systemd network configuration file (like /etc/systemd/network/10-enp2s0.network).

Why?

  • NetworkManager manages DHCP on its own.
  • It automatically assigns an IP when the interface is brought up.
  • If a systemd-networkd config exists, it might conflict with NetworkManager.

How to Fix Conflicts?

Since you have a systemd network file, it’s best to remove or disable systemd-networkd and let NetworkManager handle everything.

  1. Disable and stop systemd-networkd:

    sudo systemctl disable --now systemd-networkd
    
  2. Ensure NetworkManager is running:

    sudo systemctl enable --now NetworkManager
    
  3. Delete the old systemd config (if not needed):

    sudo rm /etc/systemd/network/10-enp2s0.network
    
  4. Restart the network interface:

    nmcli device reapply enp2s0
    

    or:

    sudo systemctl restart NetworkManager
    
  5. Check your IP:

    ip a show enp2s0
    

After this, NetworkManager will handle the DHCP automatically without interference from systemd-networkd. :rocket:


Good luck with bfinding the solution…
:bird:

Thanks a lot for the comprehensive list of solutions :slight_smile: I did first

and

Then also had to do

1 Like