iFunction
Posts: 74
Joined: Wed Nov 18, 2015 4:16 pm

Disconnect wifi

Wed Apr 06, 2016 7:34 am

Hi there,

On the raspberry pi 3, is there a way to disconnect it from the internet once it has a connection, I really need to test if something will work without a connection to the internet and can't figure out a way to do it, usually I just remove the wifi dongle but with the Raspberry Pi 3 this is no longer an option?

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Disconnect wifi

Wed Apr 06, 2016 8:28 am

Turn off the interface on the command line?

Code: Select all

sudo ifdown wlan0
That should work.

Code: Select all

sudo ifup wlan0
should start it up again.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Disconnect wifi

Thu Apr 07, 2016 8:38 am

sudo ifconfig eth0 0.0.0.0 is more likely to work, because Jessie with the raspberrypi-net-mods stuff doesn't use ifdown / ifup.

sudo ifconfig eth0 192.168.xxx.xxx/24
sudo ip route add default via 192.168.ggg.ggg

gets it running again. 192.168.xxx.xxx is the RPi's address, 192.168.ggg.ggg is your gateway address.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Disconnect wifi

Thu Apr 07, 2016 9:29 am

DougieLawson wrote:sudo ifconfig eth0 0.0.0.0 is more likely to work, because Jessie with the raspberrypi-net-mods stuff doesn't use ifdown / ifup.
True. However as ifconfig works, as simple

Code: Select all

sudo ifconfig wlan0 down
and

Code: Select all

sudo ifconfig wlan0 up
does the trick, rather than changing all the settings.

pgloor
Posts: 9
Joined: Sat Aug 08, 2015 5:20 pm

Re: Disconnect wifi

Wed Jan 17, 2018 6:36 pm

Code: Select all

 $ sudo ifconfig wlan0 down
worked for me with Raspbian Stretch Lite.

Larry_too
Posts: 3
Joined: Thu Jan 18, 2018 1:56 am
Location: EEUU, East Coast

Turn on Pi 3 WiFi

Thu Jan 18, 2018 2:15 am

Obviously a nooby here.
Just assembled a Pi 3 B, booted and all appears ready except that when I use Chromium or Help I get the message "There is no internet connection". I am in the US and setup, I think, US WiFi parameters. I am using the WiFi on a laptop to post this.

I've tried the Sudo ifup wlan0 command only to be told "unknown interface wlan0"

I've also tried the command from the previous post with the same result.

HOW DO I TURN ON the WiFi on the board.

Larry

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26442
Joined: Sat Jul 30, 2011 7:41 pm

Re: Disconnect wifi

Thu Jan 18, 2018 10:42 am

Click on the Wifi icon top right, that should give a list of available networks. Select the one you want, enter the credentials. That should be all you need to do.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Larry_too
Posts: 3
Joined: Thu Jan 18, 2018 1:56 am
Location: EEUU, East Coast

Re: Disconnect wifi

Thu Jan 18, 2018 4:11 pm

My NOOBY status is showing!

I do not see a WiFi icon at upper right, actually I see no icons over there.
All icons that I see are clustered upper left and start with the raspberry and include things like console, Math and others.

I have made no changes to the software downloaded from your site.
Appearances are that the WiFi transmitter/receiver has not yet been turned on. This would be the on board WiFi, not a dongle.

What am I missing?

Larry

Larry_too
Posts: 3
Joined: Thu Jan 18, 2018 1:56 am
Location: EEUU, East Coast

Re: Disconnect wifi

Fri Jan 19, 2018 5:13 am

Found what I was missing!

I am using a motel TV as a monitor and the video from the Pi was displayed too wide for the screen.
The right side icons were off screen. Adjusted center a bit and now I find them as predicted.
Works!
Thanks,
Larry 8-)

Return to “Beginners”