I have a fresh install of Ubuntu 12.04 32 bit on a Lenovo X220. I've bought this model on purpose as the hardware is known to perform well in 11.10 64 bit (see here) and indeed I did not have any issues so far but the one below.
If I start the laptop or I wake it up from suspend and I am running on battery power, the wifi network does not work.
Oddly enough, I do get the popup saying I connected successfully to my home's wifi, and I get a correct IP address from the DHCP on my home's access point (what I can see from ifconfig -a) but the network is dead, I can't even ping the access point. This is what I see, that is identical to when the network works.
giacecco@giaceccos-x220:~$ ifconfig -a (...) wlan0 Link encap:Ethernet HWaddr 8c:70:5a:3e:f1:80 inet addr:192.168.1.24 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::8e70:5aff:fe3e:f180/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:87965 errors:0 dropped:0 overruns:0 frame:0 TX packets:108083 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:33751259 (33.7 MB) TX bytes:111481622 (111.4 MB) giacecco@giaceccos-x220:~$ ping 192.168.1.1 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. ^C --- 192.168.1.1 ping statistics --- 77 packets transmitted, 0 received, 100% packet loss, time 76608ms
To make it work again I have noticed that it is sufficient to disable and enable wireless networking (not networking in general) from the global menu bar.
The issue cannot be reproduced by doing the same when plugged in, or using an ethernet cable.
Following the instructions here I have also amended the laptop's radio settings to be the correct ones (GB in my case).
Below is the output of lshw -C in case it was useful.
giacecco@giaceccos-x220:~$ sudo lshw -C network [sudo] password for giacecco: *-network (...) *-network description: Wireless interface product: Centrino Advanced-N 6205 vendor: Intel Corporation physical id: 0 bus info: pci@0000:03:00.0 logical name: wlan0 version: 34 serial: 8c:70:5a:3e:f1:80 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless configuration: broadcast=yes driver=iwlwifi driverversion=3.2.0-26-generic-pae firmware=126.96.36.199 build 42301 ip=192.168.1.24 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn resources: irq:44 memory:f2400000-f2401fff *-network DISABLED (...)
This is incredibly annoying, as I am such a little step to have the perfect Linux laptop.
As a start, can you suggest what exact script is behind the "Enable Networking" menu item, and how its behaviour could change depending when being on battery power?