configure wifi throught console problem, GUI is OK
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
$ 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 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 ?
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
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.
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.