2

Yesterday I have set up wifi connection on my BananaPro with bananian, a linux distribution based on debian 7. The connection was set up with 'wpa-passphrase' and then I have typed those information into, ssid and psk, into the /etc/network/interfaces. Yesterday it worked perfectly, but today it stopped working. All other devices in home have no problems with connecting to this wifi, I tried repeating all those steps from yesterday, but it still doesn't work.

Edit: I have tried the method with creating the config file with wpa_passphrase and connecting manually with wpa_supplicant, suggested by rexroni and it worked perfectly. Here is me /etc/network/interfaces file: http://pastebin.com/08GDc5Pj When I boot up BananaPro with this file the output of ifconfig, iwconfig and dmesg: http://pastebin.com/CQxh74h5 (one link, cause I cannot paste more)

Edit: I have set up another sd card with another debian installation and I'm having this same issue. It's been working when I have set it up, but when I restarted the computer it just didn't connect anymore. When I come back home I can deliver dmesg after ifup wlan0 and ifdown wlan0, but I don't quite have any idea what might be wrong. Any other things I could do? Except for using ethernet to connect to internet.

2
  • Without more informations (what's in the logs?) you have the same options like a windows user: reboot and hope that it cures the problem or reinstall Debian and hope it cures the problem.
    – ott--
    Aug 15, 2015 at 19:33
  • I wouldn't like to reinstall Debian, cause I have already spent some time to set everything up. What kind of logs should I append?
    – fulaphex
    Aug 15, 2015 at 19:37

1 Answer 1

2

First, you can double-check your /etc/network/interfaces file against mine:

auto lo 
iface lo inet loopback

auto wlan2
iface wlan2 inet dhcp
        wpa-ssid <my essid>
        wpa-psk <my passphrase>

auto eth0
iface eth0 inet static
        address <my static ip>
        network <my local network>
        netmask <my netmask>

(My ESSID and passphrase don't have spaces in them, so I don't know if you need quotes for such entries or not)

I think order of the interfaces matters. If you want to primarily use wifi, I think you need that first. Read more in man interfaces.

If that looks good, you can run some in-depth troubleshooting:

You need three basic things for wifi networking: a connection, an IP address, and appropriate routing.

You can troubleshoot by running some command line operations to see if you can connect at all (independent of the /etc/network/interfaces).

First reset everything

sudo killall wpa_supplicant
sudo ip link set <interface> down
sudo dhclient -r <interface>

Then start the process of making a connection:

# turn on the interface without auto-configuring:
sudo ip link set <interface> up

Make sure you can see the network in question:

# display wifi beacons being broadcast by nearby access points
sudo iwconfig <interface> scan

Configure and run wpa_supplicant:

# create a config file for wpa, use quotes if there's a space:
wpa_passphrase "<your ESSID>" "<your passphrase>" > ~/wpa.conf
# run wpa_supplicant on that config file, in the foreground
sudo wpa_supplicant -D wext -i <interface> -c ~/wpa.conf

The output of wpa_supplicant will help you troubleshoot the wifi connection. If it says it connects, you can either run the following commands in a new command prompt, or send wpa_supplicant to the background by pressing ctrl-z then running

# after pressing ctrl-z to pause the wpa_supplicant, run it in background
bg "%sudo"

Now run sudo iwconfig to verify your connection, the parts like "ESSID:" and "Access Point:" should have values.

Your next step is to get an IP address from your router's DHCP server:

sudo dhclient <interface>

If you are connected to the network, this really shouldn't fail. If it does... maybe reset your router? Test if it worked properly by running sudo ifconfig. Assuming you are using IPv4 addresses, you should see an IPv4 "inet addr:" that matches your router, likely a 10...* or a 192.168.1.* address.

dhclient should also set your routing appropriately, so (in the absence of other network connections to the internet) sudo ip route or sudo route should have a "default" option that points to your wifi router on the <interface>.

After that, you can test the connection to your local router:

ping <router's ip address>

Test if can connect to a remote ip address

ping 8.8.8.8 # google's dns server

Test if your DNS settings work:

ping google.com

If that works, you should be solid. If not, then you can change your /etc/resov.conf file to read

nameserver 8.8.8.8
nameserver 8.8.4.4

Now, if you've verified that you can connect to the network with these steps, you may be able to use some of the same tools to troubleshoot the /etc/network/interfaces approach.

I can help more if you share the output of sudo ifconfig, sudo iwconfig, sudo route or sudo ip route (sometimes when your connection is messed up, one or the other will hang), the relevant section of sudo iwlist <interface> scan, the /etc/network/interfaces file, and any relevant details from sudo dmesg.

20
  • Nice Post. The OP sounds like he wants to run the device stationary, probably always powered on, and connected to the same network. So configuring it via /etc/network/interfaces -like the author requested- is still pretty useful. Author won't have to do all the commands again. If I can, I will upvote you again, if you add instructions for that too. And then it will also be the answer @Fulaphex probably wants. Aug 15, 2015 at 22:30
  • Very true. It sounded like the OP already had that working before, which would rule-out problems like a totally broken config file or misspelled ESSID or something. But I added that file to the list of outputs the OP can post to help the troubleshooting.
    – rexroni
    Aug 15, 2015 at 22:39
  • Yeah, actually I'm trying to set up my home nas + backup server. The device will be connected always to the same wifi, that is why I went for the way with modifying /etc/netwotk/interfaces file. It indeed has been working yesterday. I will check Your method in a minute and will let You know about the results :) thank You very much :)
    – fulaphex
    Aug 15, 2015 at 23:14
  • This is my /etc/network/interfaces file: pastebin.com/08GDc5Pj. I tried both static and dhcp versions, static worked yesterday correctly. I have tried doing it Your way, with wpa_supplicant and dhclient and it worked perfectly fine. But still I cannot get this working with my interfaces file, hope that You spot what is wrong with it.
    – fulaphex
    Aug 16, 2015 at 3:31
  • 1
    Output from ifconfig wlan0 down && ifconfig wlan0 up pastebin.com/Tfg0Vh4z
    – fulaphex
    Aug 20, 2015 at 18:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .