Problem connecting to wireless network without logging in
Linux - NewbieThis 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
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.
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?
Distribution: Fedora mainly, but I am open to others.
Posts: 273
Rep:
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.
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.
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?
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.