LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   configure wifi throught console problem, GUI is OK (https://www.linuxquestions.org/questions/linux-networking-3/configure-wifi-throught-console-problem-gui-is-ok-767698/)

wakatana 11-08-2009 10:06 AM

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

Code:

$ 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

Code:

$ sudo iwconfig eth1 mode managed essid esus channel 6
Code:

$ 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
Code:

$ 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:

Code:

$ lspci | grep -i wireless
06:05.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)

Code:

$ uname -a
Linux cepi-laptop 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686 GNU/Linux

Code:

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
Code:

$ 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.

maslik 11-08-2009 10:14 AM

In my opinion you can discover the ip of your router by connecting your pc directly to the router and sending a ping to the broadcast.
Code:

ping -b 255.255.255.255
Hopefully your router may answer and you will see its address.

tredegar 11-08-2009 10:55 AM

Quote:

$ sudo iwconfig eth1 mode managed essid esus channel 6
That configured it, now you have to make the interface come up:
Code:

sudo ifup eth1
Then, if you have configured a static IP in /etc/network/interfaces you should be connected.
If not, you'll have to ask your AP for a LAN IP address:
Code:

sudo dhclient eth1
Then you should be connected.

#############################################

I find these things are easiest to set up by manually editing the /etc/network/interfaces file.

This might work for you:

Code:

# This is the file /etc/network/interfaces

# The "loopback" interface (do not change this):
auto lo
iface lo inet loopback


# The wired interface:
# Do not bring it up at boot, so the next line is commented
# auto eth0
# Use dhcp to get an IP
iface eth0 inet dhcp


# The wireless interface:
# Bring it up at boot
auto eth1
# Use dhcp to get an IP
iface eth1 inet dhcp
essid esus
channel 6

Then restart networking
Code:

sudo  /etc/init.d/networking  restart
Then you should be connected.


The LAN IP of the AP you are connected to is the same IP you type into your web browser to access your AP's web-page setup.

If you have not changed it, it will be the same as it says in the manual.
If you have changed it, and cannot remember it, simplest is to follow the instructions to "Factory Reset" your AP. Usually by pushing a tiny button with a paperclip as it boots up.

The WAN IP of your AP can be found by looking at its web admin pages (Login to your AP with your browser), or by going to http://whatismyip.com

wakatana 11-11-2009 11:34 AM

Quote:

Originally Posted by tredegar (Post 3749257)
That configured it, now you have to make the interface come up:
Code:

sudo ifup eth1
Then, if you have configured a static IP in /etc/network/interfaces you should be connected.
If not, you'll have to ask your AP for a LAN IP address:
Code:

sudo dhclient eth1
Then you should be connected.

hi I tried the same commands as in last post plus your suggested
Code:

sudo ifup eth1
but result is the same. I think
Code:

sudo ifup eth1
have no impact because my eth1 is up. When i issue ifconfig (without -a option) I also see eth1 so it is up. Also tried edit the interfaces file, I just added eth1 secton and now looks like

Code:

auto lo
iface lo inet loopback

iface eth1 inet dhcp
essid esus
channel 6

And restarted the network daemon, but same problem.

Quote:

If not, you'll have to ask your AP for a LAN IP address:
Code:

sudo dhclient eth1
Then you should be connected.
Is worthless to ask for addres throught DHCP client if I am not associated to AP. Still have the following:
Code:

$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      unassociated  Mode:Managed  Frequency=2.427 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.

What is wrong ?
PS sorry for late

nimnull22 11-11-2009 12:16 PM

Please do

sudo iwconfig eth1 mode managed essid esus channel 6

sudo ifup eth1

And when"dmesg | tail -n 50"

Post it here directly or through http://pastebin.com/

Thanks.

wakatana 11-11-2009 02:28 PM

Hi I did

Code:

sudo iwconfig eth1 mode managed essid "JAKLANET" channel 4
"jaklanet" is my second AP which I am trying connect to.

log is here:
http://pastebin.com/m69740856

Also I thought if is possible to turn off gnome manager and try again, but dont know how.

Thank you

nimnull22 11-11-2009 02:46 PM

I think, I have to post it here

[21937.105370] ADDRCONF(NETDEV_UP): eth1: link is not ready
[22360.254376] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[22370.884024] eth1: no IPv6 routers present
[25598.361886] ipw2200 0000:06:05.0: firmware: requesting ipw2200-sniffer.fw
[25610.212058] ipw2200 0000:06:05.0: firmware: requesting ipw2200-bss.fw
[25754.959630] tcpdump uses obsolete (PF_INET,SOCK_PACKET)
[25760.233323] device eth1 entered promiscuous mode
[25789.668539] device eth1 left promiscuous mode
[25792.087681] device eth1 entered promiscuous mode
[25798.196543] device eth1 left promiscuous mode
[25876.649347] device eth1 entered promiscuous mode
[25884.696548] device eth1 left promiscuous mode
[25941.514288] device eth0 entered promiscuous mode
[25941.515740] device eth0 left promiscuous mode
[26034.219745] device eth1 entered promiscuous mode
[26045.428583] device eth1 left promiscuous mode
[26120.164856] device eth1 entered promiscuous mode
[26121.708444] device eth1 left promiscuous mode


This is happened after ifup eht1.
What could it means?

nimnull22 11-11-2009 02:50 PM

TO: wakatana

Can you please do:

ifup wlan0, then ifdown wlan0, then ifup wlan1, then ifdown wlan1

And again post, please the output for "dmesg | tail -n 50"

Thanks.

wakatana 11-11-2009 02:57 PM

nothing, I was experimentg previous with promiscous mode.

nimnull22 11-11-2009 03:05 PM

What do you mean nothing, nothing new in log file? Or nothing happened.

Because when you do ifup eth1, looks like Ubuntu turning on etherner port, but not wireless.

That is why I asked you to do:
ifup wlan0, then ifdown wlan0, then ifup wlan1, then ifdown wlan1

And again post, please the output for "dmesg | tail -n 50"

wakatana 11-11-2009 03:45 PM

OK we made it.
I tried to exit gnome network manager that may causing problems, and everything just leave on console. So I issued:

Code:

cepi@cepi-laptop:~/Downloads$ ps aux | grep -i network
root      1116  0.0  0.3  18572  3908 ?        Ssl  12:13  0:07 NetworkManager
root    10702  0.0  0.0  2140  960 ?        S    22:07  0:00 /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth1.pid -lf /var/lib/dhcp3/dhclient-7a11bb13-8f30-451b-b607-f7c87c49f47c-eth1.lease -cf /var/run/nm-dhclient-eth1.conf eth1
cepi    10868  0.0  0.0  3040  900 pts/1    S+  22:09  0:00 grep --color=auto -i network

cepi@cepi-laptop:~/Downloads$ sudo kill 1116

cepi@cepi-laptop:~/Downloads$ ps aux | grep -i network
root    10874  1.3  0.4  9292  4356 ?        Ss  22:10  0:00 NetworkManager
cepi    10877  0.0  0.0  3036  856 pts/1    R+  22:10  0:00 grep --color=auto -i network

cepi@cepi-laptop:~/Downloads$ sudo kill 10874

cepi@cepi-laptop:~/Downloads$ ps aux | grep -i network
root    10882  1.0  0.4  9292  4364 ?        Ss  22:10  0:00 NetworkManager
cepi    10885  0.0  0.0  3036  856 pts/1    R+  22:10  0:00 grep --color=auto -i network

cepi@cepi-laptop:~/Downloads$ sudo kill -9 10882

cepi@cepi-laptop:~/Downloads$ ps aux | grep -i network
root    10888  2.0  0.4  9292  4360 ?        Ss  22:10  0:00 NetworkManager
cepi    10891  0.0  0.0  3036  864 pts/1    S+  22:10  0:00 grep --color=auto -i network

Something stops but Why NetworkManager has always differend PID and is NetworkManager gnome utility to configure network ?

I checked if I have eth1 down ?
Code:

cepi@cepi-laptop:~/Downloads$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0a:e4:b6:fa:92 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:20 Base address:0x4000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:240 (240.0 B)  TX bytes:240 (240.0 B)

Seems yes


Then I wanted to know if iwconfig finaly preserves his configuration after configuring values
(that did not work if NetworkManager was running)
Code:

cepi@cepi-laptop:~/Downloads$ sudo iwconfig eth1 mode managed essid "JAKLANET7" channel 4

cepi@cepi-laptop:~/Downloads$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      unassociated  ESSID:"JAKLANET7" 
          Mode:Managed  Frequency=2.427 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:21  Missed beacon:0

vboxnet0  no wireless extensions.

Seems finaly work after stopping NetworkManager (or its some part)


Setting correct values
Code:

cepi@cepi-laptop:~/Downloads$ sudo iwconfig eth1 mode managed essid "JAKLANET" channel 4

cepi@cepi-laptop:~/Downloads$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      unassociated  ESSID:"JAKLANET" 
          Mode:Managed  Frequency=2.427 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:21  Missed beacon:0

vboxnet0  no wireless extensions.

Bring up the interface
Code:

cepi@cepi-laptop:~/Downloads$ sudo ifup eth1
Internet Systems Consortium DHCP Client V3.1.2
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

Listening on LPF/eth1/00:16:6f:1d:c3:ea
Sending on  LPF/eth1/00:16:6f:1d:c3:ea
Sending on  Socket/fallback
DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 4
DHCPOFFER of 192.168.1.12 from 192.168.1.1
DHCPREQUEST of 192.168.1.12 on eth1 to 255.255.255.255 port 67
DHCPACK of 192.168.1.12 from 192.168.1.1
bound to 192.168.1.12 -- renewal in 129123 seconds.

Seems ok so lets check it
Code:

cepi@cepi-laptop:~/Downloads$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"JAKLANET" 
          Mode:Managed  Frequency:2.427 GHz  Access Point: 00:50:7F:A0:83:A0 
          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=58/100  Signal level=-66 dBm  Noise level=-89 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:21  Missed beacon:0

vboxnet0  no wireless extensions.

cepi@cepi-laptop:~/Downloads$ ping www.google.sk
PING www.l.google.com (74.125.39.147) 56(84) bytes of data.
64 bytes from www.google.sk (74.125.39.147): icmp_seq=1 ttl=52 time=57.6 ms
64 bytes from www.google.sk (74.125.39.147): icmp_seq=2 ttl=52 time=56.7 ms
^C
--- www.l.google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 56.793/57.208/57.623/0.415 ms

WORKS !!!

interfaces looks like
Code:

cat /etc/network/interfaces
auto lo
iface lo inet loopback

iface eth1 inet dhcp


Finaly if NetowrkManager Is not running anymore I can issue commands "on the fly" without ifup, ifdown

Code:

cepi@cepi-laptop:~/Downloads$ sudo iwconfig eth1 mode managed essid "JAKLANET6" channel 4
cepi@cepi-laptop:~/Downloads$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      unassociated  ESSID:"JAKLANET6" 
          Mode:Managed  Frequency=2.427 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:21  Missed beacon:0

vboxnet0  no wireless extensions.


cepi@cepi-laptop:~/Downloads$ sudo iwconfig eth1 mode managed essid "JAKLANET" channel 4
cepi@cepi-laptop:~/Downloads$ iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      IEEE 802.11g  ESSID:"JAKLANET" 
          Mode:Managed  Frequency:2.427 GHz  Access Point: 00:50:7F:A0:83:A0 
          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=59/100  Signal level=-65 dBm  Noise level=-88 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:21  Missed beacon:0

vboxnet0  no wireless extensions.

Result, turn of gnome network manager and everything works. Thank you all

PS please explain somebody why NetworkManager have always different PID

rkski 11-11-2009 07:29 PM

NetworkManager is a service and it's restarting automatically when you kill it (hence the new PID). You need to stop the service or not load it at boot time.

wakatana 11-13-2009 02:55 PM

Quote:

Originally Posted by rkski (Post 3753610)
NetworkManager is a service and it's restarting automatically when you kill it (hence the new PID). You need to stop the service or not load it at boot time.

Thank you for reply
But I am not understand how can be service started again if I kill it, who start it again ?. I understand that can be started after reboot, but immediately after kill ?


Last time I killed because I wanted configure wifi throught console.
Code:

root    10702  0.0  0.0  2140  960 ?        S    22:07  0:00 /sbin/dhclient -d -sf /usr/lib/NetworkManager/nm-dhcp-client.action -pf /var/run/dhclient-eth1.pid -lf /var/lib/dhcp3/dhclient-7a11bb13-8f30-451b-b607-f7c87c49f47c-eth1.lease -cf /var/run/nm-dhclient-eth1.conf eth1
cepi    10868  0.0  0.0  3040  900 pts/1    S+  22:09  0:00 grep --color=auto -i network

I expected that service will be up after reboot. So I will able using NetworkManager for roaming etc. After reboot i did not have this service in ps output.


Code:

cepi@cepi-laptop:~$ ps aux | grep -i "network"
root      1045  0.0  0.4  9292  4380 ?        Ss  11:41  0:00 NetworkManager
cepi    16873  0.0  0.0  3040  900 pts/2    S+  21:24  0:00 grep --color=auto -i network


cepi@cepi-laptop:~$ rcconf --list | grep -i network
network-manager off


cepi@cepi-laptop:~$ sudo service --status-all | grep -i network
[ ? ]  network-manager
[ ? ]  networking


cepi@cepi-laptop:~$ sudo sysv-rc-conf --list | grep -i network
network-mana
networking  0:on        6:on


cepi@cepi-laptop:~$ find /etc/rc?.d -iname "*network*"
/etc/rc0.d/S35networking
/etc/rc6.d/S35networking

Where is the truth ? is NetworkManager ON (according to ps) or OFF (according others) or what is gonig on ? Where is service that i have killed last reboot, why did it not start automaticaly ?

PS In gnome network manager last reboot (before kill) I have wireless networks, now there is only VPN.

nimnull22 11-13-2009 03:13 PM

Where is the truth ? - "ps -A |grep Network" under root

Read in GNOME documentation how to switch NM off.

wakatana 11-14-2009 05:27 AM

Quote:

Originally Posted by nimnull22 (Post 3756124)
Where is the truth ? - "ps -A |grep Network" under root

Read in GNOME documentation how to switch NM off.

Seems is running

Code:

cepi@cepi-laptop:~$ ps -A | grep -i network
 1119 ?        00:00:00 NetworkManager

But why did not I see any wireles ?

and how is possible that damenon is restarted automaticaly after kill ?
PS I dont want to turn off, want see wireless networks


All times are GMT -5. The time now is 03:12 AM.