1

I have a rpi3 connected to an ethernet cable and via wireless to a router. I believe it may be the cause of terrible connectivity while ssh'ing into my pi3 since it lags horrible on some days, not others etc.

How do I temporarily disable the wifi connection from the terminal in order to determine if its a conflict between both adapters being active at the same time or not?

1
  • 1
    Could you explain why you need two connections to the same network in the first place? Aug 15 '18 at 7:56
5

To turn WiFi off:

sudo rfkill block wifi

To turn WiFi back on:

sudo rfkill unblock wifi

To check the status of your wireless communication interfaces:

sudo rfkill list all
1
  • "sudo rfkill block wifi" and "sudo rfkill list all": 0: phy0: Wireless LAN Soft blocked: yes Hard blocked: no
    – pierre
    May 2 at 15:38
2

If you aren't worried about actually powering off the WiFi radio, you can probably just bring the WiFi's network interface down - "sudo ifconfig wlan0 down"

2
  • 1
    Before you do "sudo ifconfig wlan0 down", do me a favor and do "sudo ifconfig wlan0 up" and let me know the result. Please. "
    – Jan Hus
    Aug 15 '18 at 3:22
  • After "sudo ifconfig wlan0 down" and "sudo ifconfig wlan0": wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether b8:27:eb:f6:6c:b0 txqueuelen 1000 (Ethernet) RX packets 1523 bytes 113109 (110.4 KiB) RX errors 0 dropped 1 overruns 0 frame 0 TX packets 995 bytes 161281 (157.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
    – pierre
    May 2 at 15:20
2

Or if you want to disable WiFi at boot, in your /boot/ (or /boot/firmware/ ) "config.txt" file add or uncomment the line "dtoverlay=pi3-disable-wifi" Note that this may be simply "dtoverlay=disable-wifi" in newer configurations.

To reenable wifi, comment out the line with a leading hash (octothorpe) symbol. (a "#")

[ I use 'mcedit' as my preferred editor. Others may use vi, ed, vim, nano, or etc... For guidance on how to edit system configuration files: See other documents. Or RTFM. ]

2
  • Why not simply use rfkill block all? No reboot needed.
    – Dougie
    Feb 20 '20 at 12:11
  • @Dougie Because some of us are neat-nicks. No WiFi means you can remove all the WiFi associated packages. Like 'rfkill' as it's no longer needed.
    – dave58
    Feb 21 '20 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.