How to switch off wifi on startup or from the console

Posted by mit on Ask Ubuntu See other posts from Ask Ubuntu or by mit
Published on 2011-02-13T21:13:30Z Indexed on 2011/02/13 23:33 UTC
Read the original article Hit count: 302

I have installed ubuntu 10.04 on a laptop. Wifi is switched on by default on startup. I can disable it rightclicking the network manager icon in the gnome bar.

How can I set it to have wifi switched off as default?

Alternatively, how can I switch off wifi on the console?

I tried already the rfkill command but it does not list any devices and it does not switch off wifi, I tried different parameters.

This is a standard install of the Ubuntu 10.04 i386 Desktop Live CD on an IBM T40 Laptop.


EDIT A: This is the output of some rfkill commands on my system, and it does not affect the wifi of the laptop:

$ rfkill --help
Usage:  rfkill [options] command
Options:
    --version   show version (0.4)
Commands:
    help
    event
    list [IDENTIFIER]
    block IDENTIFIER
    unblock IDENTIFIER
where IDENTIFIER is the index no. of an rfkill switch or one of:
    <idx> all wifi wlan bluetooth uwb ultrawideband wimax wwan gps fm
$ rfkill list
$ rfkill list wifi
$ rfkill list all
$ rfkill list wlan
$ sudo rfkill list all
$ sudo rfkill block all
$ sudo rfkill block wlan
$ sudo rfkill block wifi
$

EDIT B: Now I found out that

sudo ifconfig eth1 down

turns it off.

And I can turn it on through the gnome network applet again. But the applet does not reflect the change from the commandline, it stills believes wifi is switched on. I have to switch it off and on again on the applet to switch it on again, when I switched it off from the console.

Is there a better way?

This is what the syslog looks like when I switch wireless off and on again from the network manager:

NetworkManager: <info>  (eth1): device state change: 3 -> 2 (reason 0)
NetworkManager: <info>  (eth1): deactivating device (reason: 0).
NetworkManager: <info>  Policy set '24' (eth0) as default for routing and DNS.
NetworkManager: <info>  (eth1): taking down device.
avahi-daemon[660]: Withdrawing address record for fe80::202:8aff:feba:d798 on eth1.
kernel: [  971.472116] airo(eth1): cmd:3 status:7f03 rsp0:0 rsp1:0 rsp2:0


NetworkManager: <info>  (eth1): bringing up device.
NetworkManager: <info>  (eth1): supplicant interface state:  starting -> ready
NetworkManager: <info>  (eth1): device state change: 2 -> 3 (reason 42)
avahi-daemon[660]: Registering new address record for fe80::202:8aff:feba:d798 on eth1.*.
kernel: [  965.512048] eth1: no IPv6 routers present

© Ask Ubuntu or respective owner

Related posts about networking

Related posts about wireless