Re: [Solved] Command to Toggle wifi adapter enabled/disabl
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.
Re: [Solved] Command to Toggle wifi adapter enabled/disabl
hi
i have two wifi adapters, the motherboard adapter, and a usb dongle.
i don't want to blacklist the internal adapter, but i don't want it to connect automatically either.
currently, both adapters are connecting at the same time, which doesn't make sense.
ps, if both are connected, would both contribute to my download speed?
thx!
i have two wifi adapters, the motherboard adapter, and a usb dongle.
i don't want to blacklist the internal adapter, but i don't want it to connect automatically either.
currently, both adapters are connecting at the same time, which doesn't make sense.
ps, if both are connected, would both contribute to my download speed?
thx!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 6 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: How to prevent adapter from connecting without blacklist
In the settings for the connection you can unset the option for automatically connect.
Re: How to prevent adapter from connecting without blacklist
you mean for each hotspot?
that will work, but was hoping for a device setting, rather than hotspot setting. No luck?
if i have to go to the trouble of configuring every hotspot, i'd prolly leave autoconnect on, and pick the preferred device MAC address on the wifi tab. Hm, but i must not understand the purpose of that setting, since both devices are autoconnecting. What does that device MAC address setting do?
many thx
that will work, but was hoping for a device setting, rather than hotspot setting. No luck?
if i have to go to the trouble of configuring every hotspot, i'd prolly leave autoconnect on, and pick the preferred device MAC address on the wifi tab. Hm, but i must not understand the purpose of that setting, since both devices are autoconnecting. What does that device MAC address setting do?
many thx
Re: How to prevent adapter from connecting without blacklist
Why not ?johnywhy wrote:i don't want to blacklist the internal adapter
No, by default Mint will actually be using just one of those (the first one establishing a connection).johnywhy wrote:if both are connected, would both contribute to my download speed?
Re: How to prevent adapter from connecting without blacklist
maybe because i want to be able to fallback to it, if the dongle breaks, or is lost.niowluka wrote:Why not ?johnywhy wrote:i don't want to blacklist the internal adapter
Or maybe i'm just spoiled and i want a quick gui way to enable/disable devices.
another reason i'm hesitant to blacklist the old adapter is because i'm still evaluating the new adapter.
Another reason: at home I can use the internal adapter. Elsewhere I use the dongle.
Last edited by johnywhy on Thu Sep 17, 2015 1:59 pm, edited 2 times in total.
Re: How to prevent adapter from connecting without blacklist
You may be able to accomplish what you want with
It may or may not be persistant after a reboot but if it does work and you want to reverse it just use
Code: Select all
sudo ifconfig wlan0 down
Code: Select all
sudo ifconfig wlan0 up
Re: How to prevent adapter from connecting without blacklist
Blacklisting is not permanent. It's just preventing a driver to load at boot. You can then load / unload the driver at will, thus enabling / disabling the device.johnywhy wrote:another reason i'm hesitant to blacklist the old adapter is because i'm still evaluating the new adapter.
Re: How to prevent adapter from connecting without blacklist
Update: not solved. see next post.JeremyB wrote:to reverse it just useCode: Select all
sudo ifconfig wlan0 down
Code: Select all
sudo ifconfig wlan0 up
extra credit:
i'd like to assign both to a single keyboard key as a 'toggle', but i cannot find a way to check on the up/down state of the interface. Any ideas?
Re: [Unsolved] Disable wifi adapter without blacklisting?
Update: Not solved. It worked until a reboot. Now, ifconfig return is weird, unexpected.
On boot, i can see both interfaces in Network Manager, and i get:
On boot, i can see both interfaces in Network Manager, and i get:
after this:$ sudo ifconfig
eth0 Link encap:Ethernet HWaddr ac:22:0b:0d:ee:96
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:19
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:173 errors:0 dropped:0 overruns:0 frame:0
TX packets:173 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:12642 (12.6 KB) TX bytes:12642 (12.6 KB)
ra0 Link encap:Ethernet HWaddr 00:e1:b0:27:84:71
inet addr:10.3.192.177 Bcast:10.3.255.255 Mask:255.255.0.0
inet6 addr: fe80::2e1:b0ff:fe27:8471/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7721 errors:0 dropped:0 overruns:0 frame:0
TX packets:324 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1686498 (1.6 MB) TX bytes:49929 (49.9 KB)
wlan0 Link encap:Ethernet HWaddr 0c:84:dc:09:2b:80
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
i can STILL see the internal interface in Network Manager, and i get:sudo ifconfig wlan0 down
thx for any help!eth0 Link encap:Ethernet HWaddr ac:22:0b:0d:ee:96
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:19
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:229 errors:0 dropped:0 overruns:0 frame:0
TX packets:229 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:18341 (18.3 KB) TX bytes:18341 (18.3 KB)
ra0 Link encap:Ethernet HWaddr 00:e1:b0:27:84:71
inet addr:10.3.192.177 Bcast:10.3.255.255 Mask:255.255.0.0
inet6 addr: fe80::2e1:b0ff:fe27:8471/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28698 errors:0 dropped:0 overruns:0 frame:0
TX packets:967 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6454832 (6.4 MB) TX bytes:204377 (204.3 KB)
wlan0 Link encap:Ethernet HWaddr 0c:84:dc:09:2b:80
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Re: [Unsolved] Disable wifi adapter without blacklisting?
The rfkill state might be remembered so post the output of
Code: Select all
rfkill list all
Re: [Unsolved] Disable wifi adapter without blacklisting?
JeremyB wrote:post the output ofCode: Select all
rfkill list all
$ rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: asus-wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
--how?niowluka wrote:You can then load / unload the driver at will, thus enabling / disabling the device.
thx
Re: [Unsolved] Disable wifi adapter without blacklisting?
Is this along the lines of what you're looking for?
I'm not sure which flavor of Mint you're using, but at least in Cinnamon you can easily turn on/off whichever Wifi connection you want by using the sliders.
I'm not sure which flavor of Mint you're using, but at least in Cinnamon you can easily turn on/off whichever Wifi connection you want by using the sliders.
Re: [Unsolved] Disable wifi adapter without blacklisting?
I'm in xfce.ralplpcr wrote: in Cinnamon you can easily turn on/off whichever Wifi connection you want by using the sliders.
A GUI or CLI solution would be fine.
Re: [Unsolved] Disable wifi adapter without blacklisting?
I don't have an XFCE installation handy with multiple Wifi adapters, but I think you can do that from the GUI as well. What do you see when you click on the network icon in your "systray" (panel - lower right)?johnywhy wrote:I'm in xfce.
A GUI or CLI solution would be fine.
There should be an entry allowing you to "disconnect", and I believe it should show both adapters individually... can you post a screen shot of what you see? (press PrtSc, then attach the resulting screenshot into this thread)
Here's what I see with 1 Ethernet and 1 Wifi adapter:
Re: [Unsolved] Disable wifi adapter without blacklisting?
"Disconnect" is not the same as "disable." There's no "disable" option.ralplpcr wrote:. What do you see when you click on the network icon in your "systray" (panel - lower right)? There should be an entry allowing you to "disconnect", ]
Re: [Unsolved] Disable wifi adapter without blacklisting?
Alright, then how about this?johnywhy wrote: "Disconnect" is not the same as "disable." There's no "disable" option.
Code: Select all
gksudo gedit /etc/network/interfaces
(use wlan0 or wlan1, depending on which one you want to disable)
Code: Select all
iface wlan0 inet manual
Code: Select all
sudo service network-manager restart
Re: [Unsolved] Command to Toggle wifi adapter enabled/disabl
performed all your steps, and rebooted. Adapter was disabled.ralplpcr wrote:Alright, then how about this?Code: Select all
gksudo gedit /etc/network/interfaces
then i did
adapter did not enable. Should i use a different command?sudo ifconfig wlan0 up
I googled "iface wlan0 inet manual" and saw some stuff about hotplugging. Does that mean manually plugging in the adapter? If so, can it work with the internal adapter (which is already plugged in on boot, and never unplugged).
ps, i edited my OP title to more accurately describe what i want.
thx!
Re: [Unsolved] Command to Toggle wifi adapter enabled/disabl
I don't have an XFCE box to test at the moment, but I believe from a terminal the steps should be the same. Try entering the following 3 commands to re-enable your adapter and get an IP assigned:johnywhy wrote:adapter did not enable. Should i use a different command?Code: Select all
sudo ifconfig wlan0 up
Code: Select all
sudo ip link set wlan0 up
sudo ifconfig wlan0 up
sudo dhclient wlan0
FYI - If you want to DISABLE your wlan0, you can simply enter
Code: Select all
sudo ip link set wlan0 down
Re: [Unsolved] Command to Toggle wifi adapter enabled/disabl
Tried a few different scenarios, sorry if confusing. Trying not to get confused myself!
Scenario 1: Disabled in /etc/network/interfaces
If it helps, my /etc/network/interfaces contains:
i tried to blacklist the internal adapter using the following:
Scenario 3: NOT disabled in /etc/network/interfaces or /etc/modprobe.d/blacklist
Seems that, when lshw shows wlan0 as "DISABLED", it's not really disabled (or network manager overrides the disable?)
thx!
Scenario 1: Disabled in /etc/network/interfaces
How can i get an IP assigned without connecting to a specific wifi network? I tried this and, after your first command the adapter appears in network manager, with the label "device not managed", and no wifi networks listed. Your second command has no visible affect. After your third command, the command window hangs, with no change in device manager.ralplpcr wrote:Try entering the following 3 commands to re-enable your adapter and get an IP assignedCode: Select all
sudo ip link set wlan0 up sudo ifconfig wlan0 up sudo dhclient wlan0
If it helps, my /etc/network/interfaces contains:
Scenario 2: Disabled in /etc/modprobe.d/blacklist# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
iface wlan0 inet manual
i tried to blacklist the internal adapter using the following:
However, on reboot, it's still listed in Network Manager, and i'm able to connect to a wifi network with it, using Network Manager.blacklist RT5390
blacklist wlan0
blacklist Ralink corp. RT5390 Wireless 802.11n 1T/1R PCIe
Scenario 3: NOT disabled in /etc/network/interfaces or /etc/modprobe.d/blacklist
after doing that, i notice lshw shows wlan0 as "DISABLED". However, it's still listed in Network Manager, available networks are still listed underneath it, and i'm able to connect to a wifi network with it, using Network Manager. Something seems wrong here. Same thing happens with sudo ifconfig wlan0 downralplpcr wrote:FYI - If you want to DISABLE your wlan0, you can simply enterto instantly turn it off.Code: Select all
sudo ip link set wlan0 down
Seems that, when lshw shows wlan0 as "DISABLED", it's not really disabled (or network manager overrides the disable?)
thx!
Re: [Unsolved] Command to Toggle wifi adapter enabled/disabl
Post
Code: Select all
lspci -nnk | grep -iA2 net