Ethernet settings reset after reboot

Hello,

have a problem:

NAME=“Fedora Linux”
VERSION=“36 (Workstation Edition)”

after reboot ( or „sudo ip link set enp5s0 down“) I do not have Internet:

[user@fedora ~]$ sudo ethtool enp5s0
Settings for enp5s0:
	Supported ports: [  ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	                        2500baseT/Full
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	                        2500baseT/Full
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Auto-negotiation: on
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
	Link detected: no

then I do “sudo ethtool -s enp5s0 advertise 0x008” or “sudo ethtool -s enp5s0 speed 100” and now I have internet:

[user@fedora ~]$ sudo ethtool enp5s0
Settings for enp5s0:
	Supported ports: [  ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	                        2500baseT/Full
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  100baseT/Full
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: 100Mb/s
	Duplex: Full
	Auto-negotiation: on
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: internal
	MDI-X: off (auto)
	Supports Wake-on: pumbg
	Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
	Link detected: yes

How to keep my internet connection from disappearing after a reboot?
or How do I make it try to connect only at 100Mbps?
Is this possible?

/etc/NetworkManager/systemconnections/WiredConnection2.nmconnection:

[connection]
id=Wired connection 2
uuid=6002e9c3-72aa-3856-939d-1420b8a9aa8d
type=ethernet
interface-name=enp5s0
autoconnect=true

[ethernet]
auto-negotiate=TRUE
speed=100
duplex=full

[ipv4]
method=auto

[ipv6]
addr-gen-mode=stable-privacy
method=auto

[proxy]

Thanks.

This is why it fails to connect.

It you change auto-negotiate to FALSE then it will always connect at the same speed.

This does not help. After rebooting, it’s the same whether FALSE or TRUE.

what does nmcli connection show enp5s0 --active | grep 802-3
show?

As an alternative you may want to try:

nmcli connection edit enp5s0
set 802-3-ethernet.auto-negotiate no
set 802-3-ethernet.duplex full 
set 802-3-ethernet.speed 100 
save persistent
quit
1 Like

after reboot:

[user@fedora ~]$ nmcli connection show enp5s0 --active | grep 802-3
connection.type:                        802-3-ethernet
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   0
802-3-ethernet.duplex:                  --
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        --
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            --
802-3-ethernet.wake-on-lan:             default
802-3-ethernet.wake-on-lan-password:    --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
Error: --active - no such connection profile.

The last line shows an error: Error: --active - no such connection profile.

Following the above commands changed what displays after restart. But it still doesn’t connect automatically:

[saulius@fedora ~]$ nmcli connection show enp5s0 --active | grep 802-3
connection.type:                        802-3-ethernet
802-3-ethernet.port:                    --
802-3-ethernet.speed:                   100
802-3-ethernet.duplex:                  full
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             --
802-3-ethernet.cloned-mac-address:      --
802-3-ethernet.generate-mac-address-mask:--
802-3-ethernet.mac-address-blacklist:   --
802-3-ethernet.mtu:                     auto
802-3-ethernet.s390-subchannels:        --
802-3-ethernet.s390-nettype:            --
802-3-ethernet.s390-options:            --
802-3-ethernet.wake-on-lan:             default
802-3-ethernet.wake-on-lan-password:    --
802-3-ethernet.accept-all-mac-addresses:-1 (default)
Error: --active - no such connection profile.

The last line still shows an error: Error: --active - no such connection profile.

[user@fedora ~]$ journalctl -u NetworkManager:
...
Oct 22 20:13:23 fedora NetworkManager[1038]: <info>  [1666458803.9775] manager: (enp5s0): new Ethernet device (/org/freedesktop/NetworkManager/Devices/3)
Oct 22 20:13:23 fedora NetworkManager[1038]: <info>  [1666458803.9782] device (enp5s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
...

After

[user@fedora ~]$ sudo ethtool -s enp5s0 advertise 0x008
all working until restart.
“nmcli connection show enp5s0 --active | grep 802-3” shows the same.

Could try a systemd service…

[Unit]
Description=ethtool configuration to enable 100mbps speed for the specified card
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/sbin/ethtool -s %i speed 100 duplex full autoneg on
Type=oneshot

[Install]
WantedBy=multi-user.target

save as ethtool@.service in /etc/systemd/system

sudo systemctl enable ethtool@enp5s0.service

Unfortunately, this did not help. Only helps after a reboot

[user@fedora ~]$ sudo ethtool -s enp5s0 speed 100

or

[user@fedora ~]$ sudo ethtool -s enp5s0 advertise 0x008

Did you install that as a systemd service?

edit,
I typo’d the above service, it should’ve bin /usr/sbin/ethtool

It’s corrected now, sorry about that.

Thank you. Everything is working now.