maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Troubleshooting (https://talk.maemo.org/forumdisplay.php?f=6)
-   -   Connect to WLAN from command line (https://talk.maemo.org/showthread.php?t=3782)

nite_man 2006-12-27 15:33

Connect to WLAN from command line
 
Hi!

I'd like to know is there some way to connect to WLAN from command line? I need to connect to the network right after Nokia boot. There is an only one access point.

Thanks in advance.

Michael

SeRi@lDiE 2006-12-27 16:50

I have not try this on maemo but you can give it a try... be care full I am not responsible if you brick your N770.

You need to edit the /etc/network/interfaces file to something like this....

Code:


#
# File: /etc/network/interfaces
#

# The primary network interface
auto eth1
iface eth1 inet static
        address 10.30.2.55
        netmask 255.255.255.0
        wireless-essid unix

auto eth0
iface eth0 inet dhcp
        wireless-essid null_one


SeRi@lDiE 2006-12-27 16:52

If is secure than you need to follow aditional steps..

And if you just want to do it from xterm...

ifconfig eth1 up (bring up specified interface)

iwconfig eth1 mode managed key [WEP key] (128 bit WEP use 26 hex characters, 64 bit WEP uses 10)

iwconfig essid "[ESSID]" (Specify ESSID for the WLAN)

or iwlist scan to scan for AP.

nite_man 2006-12-29 17:09

Hi,

Thanks a lot for your suggestions. More or less I understand how it should be done :)
But I'm curious a bit regarding Nokia's file interfaces. I found that it's very strange that this file doesn't contain wlan0 device. Can you post your file, for example?

SeRi@lDiE 2006-12-29 21:25

Here is my interface file...

Code:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto usb0
iface usb0 inet static
        address 192.168.2.15
        netmask 255.255.255.0
        gateway 192.168.2.14


nite_man 2007-01-01 15:48

Hmmm ... My file interfaces looks the same. So, I should add some wireless-* options to the eth0 and use wlan0 to bring up network interface? Because, when I try to run
Code:

ifconfig eth0
it give me an error that device not found

SeRi@lDiE 2007-01-01 20:08

Yes use wlan0

nite_man 2007-01-03 15:44

Well, I run following commands to bring up WLAN:

ifconfig wlan0 up # without this iwconfig gives me an error that device wlan0 not found

iwconfig wlan0 enc MY_NET_KEY mode managed essid MY_NET_ID channel 6

I see that command passes without errors (I use iwevent) but IP address is not given by DHCP and nework interface is not up.

What I do wrong?

SeRi@lDiE 2007-01-03 16:03

Did you install the wireless tools?
https://maemo.org/maemowiki/Applicat...e89da6ba5c2564

nite_man 2007-01-03 16:09

Sure. I couldn't call iwconfig and iwevent without them


All times are GMT. The time now is 00:22.

vBulletin® Version 3.8.8