Setting network rules > unsure about safety

Ubuntu Version:
26.04 LTS

Hello! I’d appreciate if someone could give an opinion on these specific network rules.

I’ve been having an issue with network after a fresh 26.04 install, where wifi connection worked normally but connecting via an ethernet cable was not working at all. Ethernet connection used to work just fine on Ubuntu 24.04 but after installing 26.04 it just stopped.

I tried to fix it by applying all the common solutions but none of them worked, then I managed to combine someone’s advice with a bit of help from an LLM, which instructed me to use these lines below, which was the only thing that worked.

My question is, since I don’t know much about networking, whether this is a safe config or not.

sudo ethtool -P enp6s00
sudo nmcli device set enp6s0 managed no
sudo dhclient -r enp6s0
sudo dhclient -v enp6s0
sudo systemctl stop NetworkManager
sudo bash -c ‘cat > /etc/systemd/network/10-enp6s0.network <<EOF
[Match]
Name=enp6s0
Network]
DHCP=yes
EOF’
sudo systemctl enable systemd-networkd
sudo systemctl restart systemd-networkd

Thank you in advance!

I would not call this configuration “unsafe” from a security perspective, but I would avoid keeping it exactly as it is because it mixes several network-management methods and makes future troubleshooting harder.

A few things stand out:

nmcli device set enp6s0 managed no tells NetworkManager to stop managing that interface at runtime; without a persistent unmanaged-device configuration, that state does not survive reboot.

dhclient -r / dhclient -v manually release and request a DHCP lease, but that becomes redundant once systemd-networkd is configured with DHCP=yes.

systemctl stop NetworkManager may also affect Wi-Fi, since NetworkManager is usually responsible for Wi-Fi on Ubuntu Desktop.

systemd-networkd and NetworkManager can coexist, but each interface should have one clear owner. Netplan supports both as renderers.

The first command uses enp6s00, while the rest use enp6s0, so I would double-check that interface name.

In the .network file, make sure it is actually [Network] rather than Network].

Since Wi-Fi already works through NetworkManager, I would first check why NetworkManager is failing to manage the Ethernet interface instead of permanently moving Ethernet to a different networking stack.

I would start with:

ip link show enp6s0
nmcli device status
nmcli connection show
sudo ethtool enp6s0
sudo netplan get
sudo journalctl -b -u NetworkManager --no-pager

If Netplan is using NetworkManager, you can try returning the interface to NetworkManager:

sudo systemctl enable --now NetworkManager

sudo nmcli device set enp6s0 managed yes

sudo nmcli device connect enp6s0

If it still does not obtain connectivity, the output of nmcli device status, sudo netplan get, and the relevant NetworkManager log messages would help determine whether the actual problem is DHCP, carrier/link state, the driver, or the connection profile.

If you intentionally want systemd-networkd to manage Ethernet while NetworkManager continues managing Wi-Fi, that can also be done, but I would configure that explicitly through Netplan rather than combining manual dhclient commands and service changes.

I have dealt with similar interface-management problems in Ubuntu/KVM environments, and having one clearly defined manager per interface makes these issues much easier to diagnose and maintain.