How do I disable and then re-enable network card?
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
How do I disable and then re-enable network card?
Hi there everyone, I'm new to Linux and wonder if there is Plug N Play commands like on Windows available on Linux. Currently, I can't dig any information on the internet unless for lshw, udev and much more. The commands I need is the below :
pnputils /disable-device {device id}
and /enable-device
These are the command on Windows, wonder if anyone have a solution to have a similiar or run these on linux. Thanks in advance!
pnputils /disable-device {device id}
and /enable-device
These are the command on Windows, wonder if anyone have a solution to have a similiar or run these on linux. Thanks in advance!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: PnP commands in Linux
I guess you mean pnputil, not pnputils. This tool: https://docs.microsoft.com/en-us/window ... and-syntax
I don't think there is a single command that is equivalent for all device types. Perhaps instead start with specifically what device you want to disable and why?
I don't think there is a single command that is equivalent for all device types. Perhaps instead start with specifically what device you want to disable and why?
Re: PnP commands in Linux
I wanna disable my network card and re-enable it. It's because my PC is kinda weird with the internal network cards. In Windows, I have to disable and enable it using the commands I stated in the ori post in order for the network card to be able to connect to internet and be used without any issues. Without disable and enabling it, network card will have issues in Windows, and also Linux of course.xenopeek wrote: ⤴Mon May 23, 2022 9:34 am I guess you mean pnputil, not pnputils. This tool: https://docs.microsoft.com/en-us/window ... and-syntax
I don't think there is a single command that is equivalent for all device types. Perhaps instead start with specifically what device you want to disable and why?
Re: PnP commands in Linux
And yea its the pnputil.exe in windows which have the command that I stated above.xenopeek wrote: ⤴Mon May 23, 2022 9:34 am I guess you mean pnputil, not pnputils. This tool: https://docs.microsoft.com/en-us/window ... and-syntax
I don't think there is a single command that is equivalent for all device types. Perhaps instead start with specifically what device you want to disable and why?
Re: How do I disable and then re-enable network card?
Also, a thing to mention is that the network card will boot as "The device is not working" and therefore there is no logical names to do sudo ifconfig name up.
-
- Level 8
- Posts: 2297
- Joined: Sat Sep 17, 2016 6:40 pm
- Location: England
Re: How do I disable and then re-enable network card?
Rather trying try to find an equivalent to your Windows bodge, it would be better to fully describe your problem in order to get a proper fix.
Cliff Coggin
Re: How do I disable and then re-enable network card?
If the NIC shows in
you can try
or maybe
If need be,
Supposedly at least of one those does what Windows' PNPUTIL does.
lspci
as e.g.Code: Select all
[ ... ]
00:19.0 Ethernet controller: Intel Corporation 82567LM-3 Gigabit Network Connection (rev 02)
[ ... ]
Code: Select all
sudo sh -c 'echo -n 1 >/sys/bus/pci/devices/0000:00:19.0/reset'
Code: Select all
sudo sh -c 'echo -n 1 >/sys/bus/pci/devices/0000:00:19.0/rescan'
Code: Select all
sudo sh -c 'echo -n 1 >/sys/bus/pci/devices/0000:00:19.0/remove && sleep 1 && echo -n 1 >/sys/bus/pci/rescan'
Re: How do I disable and then re-enable network card?
Could OP just use ip(8) to enable and disable the network interfaces? IE:
ip link set IFACE [up|down]
I'm also Terminalforlife on GitHub.
Re: How do I disable and then re-enable network card?
No; see just above me; there's seemingly nothing to ip up/down. I assume it's a matter of a firmware reload trigger and that might point to possible better solutions such as resetting the card from the initramfs so that the later module load finds it in consistent state -- but if it's not working on Windows either, whatever I guess, at least for now.
Re: How do I disable and then re-enable network card?
Have no luck on trying all the above, my network card is bcm4359 which is using the firmware-b43-installer. Whenever I boot, network card will either be disabled and wifi internet connections cannot be turned on, or the card works and it can find internet connections, but it will be stucked at connecting when prompt to be connected and coming out lots of internet password request, and then the network card will went down and can't enable wifi anymore.
This issue also happens in Windows but a different situations. In windows, it will boot fine or sometimes marked as problematic, and after internet connected after a few mins of usage it will disconnect from the internet and the network card cannot connect to WiFi anymore. But this problems are all fixed by everytime I boot like I said I created a bat file with the first post commands to disable and enable the network card and it works well without any issue till the next reboot.
Wonder if anybody had any similiar problems and have any other possible solutions? Thanks!
This issue also happens in Windows but a different situations. In windows, it will boot fine or sometimes marked as problematic, and after internet connected after a few mins of usage it will disconnect from the internet and the network card cannot connect to WiFi anymore. But this problems are all fixed by everytime I boot like I said I created a bat file with the first post commands to disable and enable the network card and it works well without any issue till the next reboot.
Wonder if anybody had any similiar problems and have any other possible solutions? Thanks!
Re: How do I disable and then re-enable network card?
So as to give people google fodder you will want to post output of
inxi -Fxz
.Re: How do I disable and then re-enable network card?
Note that you can just mouse-select the text in a terminal window, rclick-copy and rclick-paste into a reply box such as here on the forum; preferably in between
Any case; am not finding similar issue for your Lenovo G460 with BCM43228. Your v2.15 BIOS version appears latest -- but it's a system from circa 2010 and with specifically troublesome closed/proprietary Broadcom WiFi. I believe you can try to run
which will install a driver, and then reboot to see. If not I'll need to excuse myself from the thread; am not a mobile tech person, and this system is getting to be too old to have many relevant google results around even if they exist.
[code ]...[/code]
tags (also available from the </>
button above the reply box when you are replying) so as to retain formatting.Any case; am not finding similar issue for your Lenovo G460 with BCM43228. Your v2.15 BIOS version appears latest -- but it's a system from circa 2010 and with specifically troublesome closed/proprietary Broadcom WiFi. I believe you can try to run
Code: Select all
sudo apt-get install bcmwl-kernel-source
Re: How do I disable and then re-enable network card?
I tried installing drivers too, but doesn't fix the problems. It might not be driver issues but others which I'm not sure. As in Windows, just a simple disabling and enabling the device back again fix the problem. On Linux, I can't find anything to enable and disabling the driver unfortunately, bad for me as I really wanna try out Linux mint
Re: How do I disable and then re-enable network card?
Have you tried the exact apt-get command (and reboot) I suggested?
Otherwise; my above advised echoing into sysfs should disable/enable, certainly the last remove/rescan. No other suggestions I'm afraid...
Otherwise; my above advised echoing into sysfs should disable/enable, certainly the last remove/rescan. No other suggestions I'm afraid...
Re: How do I disable and then re-enable network card?
Yup I have tried the apt-get install bcmwl-kernel-source command and sudo reboot. But didn't work
Also sometimes the echoing commands works, it does disabled the network card, but then I can't enable it anymore for some reason. Well, I guess I have to abandon the toughts of using Linux on this old machine and stick with Windows 10 then
Re: How do I disable and then re-enable network card?
Well; it's supposedly at least somewhat Broadcom specific, so I guess it might be worth a shot to see if the board's expert on those matters feels anything worth mentioning; he'll get pinged by the below quote. I myself am as said not a mobile tech person.
Just so as to doubly note for his potential sake, in case it needs to be undone again for the sake of further tries: bcmwl-kernel-source has been installed, i.e., the driver DKMS-ed.
Just so as to doubly note for his potential sake, in case it needs to be undone again for the sake of further tries: bcmwl-kernel-source has been installed, i.e., the driver DKMS-ed.
Re: How do I disable and then re-enable network card?
Try:
Reboot
Also post what this shows:
Code: Select all
sudo apt remove firmware-b43-installer && sudo apt install --reinstall bcmwl-kernel-source
Also post what this shows:
Code: Select all
iwconfig
Re: How do I disable and then re-enable network card?
Hi there sorry for the late reply, tried the command too and still not working. Have uninstalled Linux Mint, but I'm always interested in testing and moving over from Windows, just need the WiFi thingy to be fixed like on Windows.
Just an off topic right here, maybe anyone knows whats the problem of my Mini PCI-E slot is or any other things that may be related to cause this network card issue? I bought another Intel Mini PCI-E network card too, and also it's the same problem on Windows and I have to disable and enable using the commands in the bat file everytime I boot up.
Thanks in advance!
Just an off topic right here, maybe anyone knows whats the problem of my Mini PCI-E slot is or any other things that may be related to cause this network card issue? I bought another Intel Mini PCI-E network card too, and also it's the same problem on Windows and I have to disable and enable using the commands in the bat file everytime I boot up.
Thanks in advance!