Skip to main content
Welcome guest. | Register | Login | Post

what are the debian-based console commands to start the wireless network?

3 replies [Last post]
Offline
Joined: 2006-06-19

I recently got an ASUS laptop. Everytime I want wireless connection, I have to go to
the network GUi window (xncsconfigwrapper), click the connection type and choose to
connect it. [A pain in the neck - especially with a small keyboard.] So I want to
write a script to connect via wireless and put it in .kde/Autostart (or /etc/init.d).
Then everytime I log in, it'll automatically connect.

So what are the console command. I don't think (but correct me if wrong) it's

/etc/networking

That seems to intiate the LAN network (via eth0 10/100).

Sheng-Chieh

tbuitenh's picture
Offline
Joined: 2005-12-21
I don't use a debian-like

I don't use a debian-like system, but these commands worked for me before I started using NetworkManager. Note this is from memory, so do read the manual pages before trying:

iwlist scanning

(look up device (eg eth1) and essid in output of that)

or:

iwlist eth1 scanning

(this is faster if you already know the device is eth1)

then:

iwconfig eth1 essid somenetwork key s:somepassword
dhclient eth1

(the key part may work differently dependent on the network you're connecting to, and is unnecessary on unprotected networks)

Offline
Joined: 2006-06-19
Thank you for replying. Ran

Thank you for replying.

Ran as root (same answer as an user) and got

> iwlist scanning

lo Interface doesn't support scanning.

eth0 Interface doesn't support scanning.

wifi0 Interface doesn't support scanning.

Warning: Driver for device ath0 has been compiled with version 22
of Wireless Extension, while this program supports up to version 20.
Some things may be broken...

ath0 Scan completed :
Cell 01 - Address: 00:06:25:D7:B5:F3
ESSID:"WeKnowWhoYouAre!"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=41/94 Signal level=-54 dBm Noise level=-95 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s
Extra:bcn_int=100
Cell 02 - Address: 00:14:6C:23:E9:B6
ESSID:"NETGEAR"
Mode:Master
Frequency:2.462 GHz (Channel 11)
Quality=12/94 Signal level=-83 dBm Noise level=-95 dBm
Encryption key:off
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s
Extra:bcn_int=100
Cell 03 - Address: 00:14:95:A3:A6:A1
ESSID:"2WIRE357"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=3/94 Signal level=-92 dBm Noise level=-95 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Cell 04 - Address: 00:0F:B5:3B:DA:6D
ESSID:"Redwood"
Mode:Master
Frequency:2.437 GHz (Channel 6)
Quality=2/94 Signal level=-93 dBm Noise level=-95 dBm
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
12 Mb/s; 24 Mb/s; 36 Mb/s; 9 Mb/s; 18 Mb/s
48 Mb/s; 54 Mb/s
Extra:bcn_int=100
Extra:wpa_ie=dd160050f20101000050f20201000050f20201000050f202
Extra:ath_ie=dd0900037f0101000aff7f

Do I have enough informations? I'm not understanding the iwconfig and dhclient commands. What does
essid, somenetwork, key, & somepassword are? Also am I'm using eth1 (it says ath0)?

Sheng-Chieh

p.s. Update: essid is probably WeKnowWhoYouAre!. What are the other variables?

tbuitenh's picture
Offline
Joined: 2005-12-21
Okay, so the wireless

Okay, so the wireless device is called ath0 on your computer.

Let's have a look at the networks you found:

ESSID:"WeKnowWhoYouAre!"
...
Encryption key:on

This one has encryption enabled. To use this, you need to know a password or some other kind of key (yes, there are different kinds of keys, see man iwconfig, search for key and look at the examples listed in that section of the manual).

ESSID:"NETGEAR"
Encryption key:off
...
ESSID:"2WIRE357"
Encryption key:on
...
ESSID:"Redwood"
Encryption key:on

Assuming you don't know any of the keys, your only choice is NETGEAR. So let's tell the wireless device to use that one:

iwconfig ath0 essid NETGEAR

Note this still might not work, it's possible the owner of the network has enabled MAC address checking, which makes the access point refuse to connect to any wireless network card it wasn't explicitly told to accept.

What we have done now is equivalent to plugging in a network cable. You can't use the network just yet, we need to find a DHCP server and ask it to give us an IP address. The command to do that is:

dhclient ath0

Good luck!

Comment viewing options