Configure wifi throught console problem, GUI is OK

Hi gurus,
I am trying to connect to wifi access point with terminal, I set up my own access point (no encryption or MAC filters)
I ran followings commands

$ sudo iwlist eth1 scanning 
eth1      Scan completed :
          Cell 01 - Address: 00:11:2F:A2:99:1C
                    ESSID:"esus"
                    Protocol:IEEE 802.11g
                    Mode:Master
                    Frequency:2.437 GHz (Channel 6)
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=97/100  Signal level=-23 dBm  
                    Extra: Last beacon: 48ms ago
$ sudo iwconfig eth1 mode managed essid esus channel 6
$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      unassociated  Mode:Managed  Frequency=2.437 GHz  
          Access Point: Not-Associated   Bit Rate:0 kb/s   Tx-Power=20 dBm   
          Sensitivity=8/0  
          Retry limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

vboxnet0  no wireless extensions.

But when I use graphic tool in ubuntu 9.10 and then check it with iwconfig everything is OK

$ iwconfig 
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"esus"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:11:2F:A2:99:1C   
          Bit Rate:54 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0  
          Retry limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=99/100  Signal level=-23 dBm  Noise level=-87 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

vboxnet0  no wireless extensions.

my box and wifi card:

$ lspci | grep -i wireless
06:05.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)
$ uname -a
Linux cepi-laptop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux
dpkg -l | grep wireless-tools
ii  wireless-tools                       29-2ubuntu6                                Tools for manipulating Linux Wireless Extens

Also I have another question, lets say I am connected to an AP but DHCP is disabled, also there is running web interface on AP throught I can set up DHCP and obtain IP address. How do I know what is IP of the AP which I am connected, is there a solution or I have to reset AP ?

I had idea to scann whole network with

$ echo -ne {0..255}.{0..255}.{0..255}.{0..255}"\n" > addresses
$ sudo nmap -sS -iL addresses

I know this is terrible waste of system resources, and my box stops responding and start swaping after I issued echo command :), but I dont know anything else, problably set some kind of broadcast ping or something like that, is this possible ?

What I am doing wrong ? Thanks a lot.

nobody :frowning: