[systemd-devel] networkd: Is auto-negotiation turned off when specifying parameters in a link file?

poma pomidorabelisima at gmail.com
Wed Apr 8 15:28:58 PDT 2015


On 08.04.2015 23:05, Lennart Poettering wrote:
> On Wed, 08.04.15 22:13, Paul Menzel (paulepanter at users.sourceforge.net) wrote:
> 
>>> Wouldn't it suffice to unplug the ethernet cable, then use ethtool to
>>> turn this on, then replug it, and measuring the time until networkd
>>> notices the link beat is back?
>>
>> It would. But this is a rented Hetzner server and I have no access to
>> the data center. Do you have another idea. Please keep in mind that I
>> also only have remote access using that NIC. ;-)
> 
> Then, I figure a udev rule should do. Something like this (untested:)
> 
> ACTION=="add", SUBSYSTEM=="net", KERNEL!="lo", RUN+="/usr/bin/ethtool $name ..."
> 
> Replace the "..." of course with the ethool options you need.
> 
> This would then be run immediately when the device appears. If this
> makes a measurable difference, then let us know.
> 
> Lennart
> 

/etc/udev/rules.d/10-speed1G-enp1s6.rules
ACTION=="add", SUBSYSTEM=="net", RUN+="/usr/sbin/ethtool -s enp1s6 advertise 0x20"

:03 systemd[1]: Starting Network Service...
:05 systemd-networkd[1612]: enp1s6          : link configured
:05 systemd-networkd[1612]: enp1s6          : gained carrier
:06 systemd-networkd[1612]: enp1s6          : lost carrier
:09 systemd-networkd[1612]: enp1s6          : gained carrier

~~~

/etc/udev/rules.d/10-speed1G-enp1s6.rules-

:15 systemd[1]: Starting Network Service...
:17 systemd-networkd[1633]: enp1s6          : link configured
:17 systemd-networkd[1633]: enp1s6          : gained carrier




More information about the systemd-devel mailing list