You are not logged in.
I have a Qualcomm Atheros E2400 NIC (also called Killer NIC) that's not supported by default. I see posts here and on the internet about compiling a module or applying kernel patches, but I found a much more elegant way by scrolling down on the askubuntu forums.
# modprobe alx
# echo 1969 e0a1 > /sys/bus/pci/drivers/alx/new_id
[ 102.690627] alx 0000:04:00.0 eth0: Qualcomm Atheros AR816x/AR817x Ethernet [40:8d:5c:50:9f:a8]
[ 102.692102] alx 0000:04:00.0 enp4s0: renamed from eth0
[ 102.715048] IPv6: ADDRCONF(NETDEV_UP): enp4s0: link is not ready
[ 102.716121] IPv6: ADDRCONF(NETDEV_UP): enp4s0: link is not ready
[ 105.708564] alx 0000:04:00.0 enp4s0: NIC Up: 1 Gbps Full
[ 105.709137] IPv6: ADDRCONF(NETDEV_CHANGE): enp4s0: link becomes ready
Voila! It works.
After a reboot though, this is gone. I can simply put this in some script but I'm sure there's a better way to make this stick. What's the proper way of making this permanent?
Thanks!
Last edited by mouseman (2016-01-24 08:15:23)
Offline
This will do the first part...
https://wiki.archlinux.org/index.php/Ke … e_handling
I'm not sure about the second part though.
Offline
Thanks. I knew that part too, it's the second part I'm not sure of either.
I'm sure it's fine putting it in some script somewhere, I'm not dependent on this NIC as it's the second one used by virtual machines that I only start manually.
I'm just interested to know how to do this if it were my only NIC that I wanted to load during boot time.
Offline
Maybe systemd oneshot service set with something like "Before=network" would do the trick?
Offline
I think only some script launched like bart_vv suggested would work. Otherwise, you would need some special support for this feature in udev and pretty likely there is none. Though you may try your luck with google.
Anyway, it's a cool trick this new_id. I didn't know something like that exists.
Last edited by mich41 (2016-01-21 21:05:02)
Offline
Thanks. I knew that part too, it's the second part I'm not sure of either.
I'm sure it's fine putting it in some script somewhere, I'm not dependent on this NIC as it's the second one used by virtual machines that I only start manually.
I'm just interested to know how to do this if it were my only NIC that I wanted to load during boot time.
This is probably the best way.
I'll have a look tomorrow.
Thanks!
Offline
Created the following file as /usr/lib/systemd/system/killer-nic.service:
[Unit]
Description=Loads alx module and inserts new id's
Before=network
[Service]
Type=oneshot
ExecStart=-/sbin/modprobe -q alx
ExecStart=/bin/bash -c "echo '1969 e0a1' > /sys/bus/pci/drivers/alx/new_id"
[Install]
WantedBy=multi-user.target
Enabled it:
# systemctl enable killer-nic.service
Created symlink from /etc/systemd/system/multi-user.target.wants/killer-nic.service to /usr/lib/systemd/system/killer-nic.service.
Reboot, the NIC shows up .
Awesomeness!
Offline
I think only some script launched like bart_vv suggested would work. Otherwise, you would need some special support for this feature in udev and pretty likely there is none. Though you may try your luck with google.
Anyway, it's a cool trick this new_id. I didn't know something like that exists.
You can write to sysfs in udev rules, so you could try having a rule along the lines of:
<matches>, ATTR{new_id}="whatever"
You just need to make sure your matches uniquely match the device (you wouldn't want to set new_id on wrong/parent devices!).
Edit: obviously the matches should include the old id.
Last edited by ukhippo (2016-01-24 11:07:23)
Offline