LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2008, 01:48 PM   #1
basis1980
LQ Newbie
 
Registered: Nov 2007
Posts: 15

Rep: Reputation: 0
Problem connecting to wireless network without logging in


Hello,

Got an almost absurd problem. I have configured a windows domain with a couple of ubuntu desktops. All of the pc's connect to network using us robotics usr805418 wireless card. After boot I want my pc's to connect to wireless router (with WAP2 security) without actually logging in.

Once I log in it automatically connects to wireless network without any problem. However if I do not login I cannot ping the device (it does not connect).

I tried to give static IP by editing /etc/network/interfaces. Here is what I have:

auto ath0 inet static
address 192.168.2.106
gateway 192.168.2.1
dns-nameservers 192.168.2.2
netmask 255.255.255.0
wpa-driver wired (I am not sure of this but I tried everything else)
wpa-ssid mynetworkssid
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk mypsk

It recognizes wifi card as ath0 although ifconfig -a lists a wifi0 device..

However although it takes 106 as IP I cannot ping it if I do not log in first. Using ethernet cable it is possible to connect to network even if I do not log in.

Anybody has an answer why this problem occurs with wifi?
 
Old 06-28-2008, 06:47 AM   #2
BallsOfSteel
Member
 
Registered: Mar 2008
Location: Florida
Distribution: Fedora mainly, but I am open to others.
Posts: 273

Rep: Reputation: 34
To my knowledge, in Fedora 9, the network manager (what connects you to wireless networks) doesn't start (the service) until you login into Gnome. That seems to be what you're running into. This has been the case in ANY OS I've ever used.
 
Old 06-28-2008, 07:08 AM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Actually you should be able to do this, although it will likely involve writing a short (and likely easy) script to run at boot time. Basically, you need to have the script do two things. First, you need to wpa_supplicant which should configure your card and connect it to the access point. The second step would be to request an IP address using the ifup command.

There might also be a way to do this via the Fedora services, but since I don't use Fedora, I'm not exactly sure how you would get that to run at boot.
 
Old 06-29-2008, 12:28 PM   #4
basis1980
LQ Newbie
 
Registered: Nov 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hangdog42 View Post
Actually you should be able to do this, although it will likely involve writing a short (and likely easy) script to run at boot time. Basically, you need to have the script do two things. First, you need to wpa_supplicant which should configure your card and connect it to the access point. The second step would be to request an IP address using the ifup command.

There might also be a way to do this via the Fedora services, but since I don't use Fedora, I'm not exactly sure how you would get that to run at boot.
should I write it into /etc/rc.local? I haven't dealt with wpa_supplicant before could you guide me on the script?
 
Old 06-30-2008, 07:25 AM   #5
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
Quote:
I haven't dealt with wpa_supplicant before could you guide me on the script?
It should be pretty easy. After you've installed wpa_supplicant, you'll need to edit its configuration file to match your network. Check out my help site, I've got an example of what it can look like and also have a look at the man page for additional options.

Once you've got that set, you just need to add a couple of lines to a startup file, and rc.local is probably a fine place. The first line would start wpa_supplicant:

/path/to/wpa_supplicant -Bw -Dwext -c/path/to/wpa_supplicant.conf -iwlan0


Make sure that you adjust the -i to match your wireless interface. After that has been run, I usually find it necessary to give it a few seconds to scan and configure the interface so I have a sleep line:

sleep 5

Which causes the script to pause for five seconds. You may not need this or you may need to adjust it. Once everything is ready, you just need to request an IP address from the DHCP server:

/path/to/ifup wlan0

Again, replace wlan0 with whatever your wireless interface actually is. If all goes well, that should do the trick.
 
Old 06-30-2008, 12:55 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
However although it takes 106 as IP I cannot ping it if I do not log in first. Using ethernet cable it is possible to connect to network even if I do not log in.

Anybody has an answer why this problem occurs with wifi?
I think this should be easy to fix.

Modify your /etc/network/interfaces file so it looks like this:
Code:
auto ath0 
iface ath0 inet static
address 192.168.2.106
gateway 192.168.2.1
dns-nameservers 192.168.2.2
netmask 255.255.255.0
wpa-driver wired (I am not sure of this but I tried everything else)
wpa-ssid mynetworkssid
wpa-ap-scan 1
wpa-proto RSN
wpa-pairwise CCMP
wpa-group CCMP
wpa-key-mgmt WPA-PSK
wpa-psk mypsk
The changes are in red
Green is "weird stuff"

Your dns-nameservers 192.168.2.2 is a new one for me - Are you running a local nameserver? I just have a gateway address-of-my-router line (same as you).
wpa-driver wired you can probably remove (I don't have it and all is sweet)

Anyway, make the changes to rc.local
Reboot, do not login.

Is the interface up?
If not, you may have a problem that I have had with a couple of installations, and the wireless interface needs to be brought down and up again, by a couple of commands in the file /etc/rc.local
Put these before the final exit 0 in rc.local

Code:
# Stupid wireless needs to be restarted, 
# I do not know why, so just do it:
ifdown ath0
ifup ath0
Reboot, and let us know what happens.

Last edited by tredegar; 06-30-2008 at 12:57 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem connecting to existing wireless network using KDE after updating to Sue 10.3 mrukjames Linux - Laptop and Netbook 4 05-05-2008 06:59 AM
Connecting to Wireless Network Zephryos Linux - Software 3 01-28-2006 05:45 PM
Problem connecting to wireless network Tyr_7BE Linux - Wireless Networking 7 05-06-2005 08:15 AM
Connecting to Wireless network ms82xp Linux - Wireless Networking 1 02-06-2005 08:44 PM
need help connecting to my wireless network skiguy Linux - Wireless Networking 6 11-05-2003 10:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration