LinuxQuestions.org
Register a domain and help support LQ
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 02-23-2012, 07:00 PM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Rep: Reputation: 30
Wireless keeps asking for password and pops up when LAN (eth0) is available


This is a fresh install of Ubuntu 11.10 and I haven't put this on a laptop before, so this is new to me (wireless with the newer network manager).

It quickly found eth0 and configured. Sweet.

I pulled it off and looked for the wireless network, which it found, and I connected to it. Also sweet.

The problem appears to be that it wants to connect to the wireless now, even when I have eth0 available. On startup, it connects to eth0, then starts asking over and over again for the wireless password.

Not sweet.

How do I tell it to ignore wireless when eth0 is available or already connected?
 
Old 02-24-2012, 02:21 AM   #2
ac_kumar
Member
 
Registered: Aug 2011
Distribution: Ubuntu, Fedora
Posts: 166

Rep: Reputation: 8
you can right click on network connection icon in top right side(if gnome)
select edit connections and then click wireles than select wireless listed
than click edit if connect automatically is selected uncheck it.
And will not try to connect automatically.
 
Old 02-24-2012, 12:35 PM   #3
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ac_kumar View Post
you can right click on network connection icon in top right side(if gnome)
select edit connections and then click wireles than select wireless listed
than click edit if connect automatically is selected uncheck it.
And will not try to connect automatically.
I don't think that's quite the functionality I'm looking for, but it's certainly an option.

Is there no way for it to automatically detect some kind of priority like in windows? IE: If it's plugged in to eth0, use that. If eth0 becomes unavailable, /then/ try to connect to wlan0. If eth0 becomes re-available, disconnect from wlan0 and reconnect to eth0.

I spend good portions of the day docking and undocking this laptop at work (going to meetings). When I'm at my desk, the higher speed lan is the way to go (lots of file transfers, svn, etc), but it'd be good to not have to mess with the network settings every time I get up for and sit down from a meeting that I bring my laptop to. Windows did this automatically, so it's obvious the capability can exist, but does it exist in linux?
 
Old 02-24-2012, 12:44 PM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,022

Rep: Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558Reputation: 558
I think you missed the point.
If you have your wireless network to not automatically connect to a certain network, it is always available to connect to.
If the password is already saved, when you want to connect to it then scroll down network listings & connect.
The available networks notification also has a box that says, "do not ask again"
 
Old 02-24-2012, 01:06 PM   #5
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by EDDY1 View Post
I think you missed the point.
If you have your wireless network to not automatically connect to a certain network, it is always available to connect to.
If the password is already saved, when you want to connect to it then scroll down network listings & connect.
The available networks notification also has a box that says, "do not ask again"
No, I think perhaps you've not understood me.

I can set it to not connect automatically. That's all well and good. But what I was hoping to avoid is the results of that ... going in and re-selecting the network I want to be on each time I switch positions.

For example:

Let's say I set it up to connect automatically to eth0 and not automatically to this particular wireless lan.

I start out at my desk. All is well.

I leave my desk, and the laptop detects (after some delay) that eth0 is disconnected, so it shows no connection. To connect to my wireless network, I have to go select it from the network manager.

I now go and sit back at my desk. eth0 reconnects, but the wireless network is also still attached. I have to tell it explicitly to disconnect.

While /both/ are connected, I do not know, and probably have no control over, which network my data is being sent through or requested from when obviously I want to use just the wired network (faster / more stable / more secure).

So while I realize the network is "still there" and I can still connect to and disconnect from it, I'd rather not have to make changes to my network settings (even simply connecting and disconnecting by hand) the 5 to 8 times a day I'd have to do it ... each time having to do it twice, once when I leave my desk and once when I return.

Especially since any time I might /forget/ to make that wireless connection, even though it's available, it would "fail silently", and I simply wouldn't be receiving my messages or e-mails, some of which are time sensitive.

So I'm asking if there's some kind of automatic network switching with priorities that can be set up. Windows does this, though it's not configurable (that I'm aware of) by simply preferring wired over wireless.
 
Old 02-24-2012, 01:20 PM   #6
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
And just to be clear, I don't know that this is a big deal, that's why I was asking.

I can leave both to "connect automatically", and I get mostly the right behavior, except that both networks are fully connected any time I'm docked.
 
Old 02-24-2012, 04:20 PM   #7
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
"except that both networks are fully connected any time I'm docked."
.. and that's a problem?
 
Old 02-24-2012, 04:43 PM   #8
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by david1941 View Post
"except that both networks are fully connected any time I'm docked."
.. and that's a problem?
I don't know ... that's part of what I'm asking.

I don't know how to check whether it's using eth0 or wlan0 for its communication. Using wireless when eth0 is available would be way sub-optimal, so if it semi-randomly bounces between them, that'd not be good. If I'm doing stateless transactions over the network that use information from the originator as a kind of client key, it could break that as well.

I don't know what the behavior of having a second network connected looks like, in short.

If it /isn't/ an issue, then ... well ... I guess that's that.
 
Old 02-24-2012, 05:08 PM   #9
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
Each connection is keyed to the source IP/port and Destination IP/port and so will not vary within that connection. What will happen is that two different connections, say to a smtp server may go through two routes (each on only one route). Mas nix... It doesn't really make a difference how it is delivered to the programs/servers so long as the IP/port setup works as it should. That's what TCP/IP does and it is transparent to the programs. I'm dual hosted here (IPv6/v4) and different servers switch back and forth all the time depending on the hosts/clients. No problem.

Last edited by david1941; 02-24-2012 at 05:09 PM. Reason: fix funny icons
 
Old 02-24-2012, 05:16 PM   #10
david1941
Member
 
Registered: May 2005
Location: St. Louis, MO
Distribution: CentOS6
Posts: 267

Rep: Reputation: 57
And, the kernel's routing procedure should select the fastest route to so the best (fastest) connection will be preferred.
 
Old 02-24-2012, 05:27 PM   #11
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by david1941 View Post
And, the kernel's routing procedure should select the fastest route to so the best (fastest) connection will be preferred.
Then I think we're good to go!

Thanks for the info. Wasn't sure what the best way to set all this up was and it wasn't behaving the way it "seemed to me" like it should have .
 
Old 02-24-2012, 05:34 PM   #12
Heraton
Member
 
Registered: Apr 2011
Location: Germany
Distribution: Mint 10, openSuSE
Posts: 58

Rep: Reputation: 3
Smile Proper configuration or some kind of workaround

Hi there!

I myself hardly use network manager at all, so I can't tell if such a feature exists. But from a network administrators view, there are still some options:

You could set the metrics for your wireless higher than that of your ethernet device, if this is not standard already. To get that info, you can simply run
Code:
route -n
in your shell. It should show two entries for 0.0.0.0 network with 0.0.0.0 genmask (aka the route to internet), just having different routers.

Your routing table is the key to tell where your traffic goes. It first checks for all entries that match your target network and then simply chooses the entry with the longest subnet mask. If two of them are equal, the kernel will check which one of them has better metrics and chooses that one. All the time.

If you want to double check, you can run
Code:
sudo tcpdump -i eth0
This command line sniffer ships with a lot of distributions and shows whether there is traffic or not.

You could of cause use scripting too. Just run a script that checks if eth0 is available and disable wlan0 in that case:
Code:
#!/bin/bash
#
# infinite loop
while true;
do
	# testing whether eth0 is available:
	# if connected and up, there will be the RUNNING flag in ifconfig
	#
	IS_UP=`eval "ifconfig eth0" | grep RUNNING`
	if [ 0 != ${#IS_UP} ]
	then
		echo "shutting down eth1"
		ifconfig eth1 down
	else
		echo "starting eth1"
		ifconfig eth1 up	
	fi
	# just to reduce the amount of cpu load. Configure to suit your needs
	sleep 30
done

Okay, I guess testing my script took too long, but anyway, now that it is done, I want to share it anyway. Maybe some day some one stumbles across is and likes it.


Regards,

Heraton

Last edited by Heraton; 02-24-2012 at 05:37 PM. Reason: typo
 
Old 02-24-2012, 05:38 PM   #13
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 221

Original Poster
Rep: Reputation: 30
Very cool, Heraton.

As you suspected, the metrics for my wireless device are higher than my eth0 device. I actually have 4 entries in this case, but the others are equally partitioned out (metris of 0 [genmask and destination 0.0.0.0 on eth0], 1 [main eth0], 1000, and 2 [wlan0] for the different destination tables).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Creating a Samba-Server: Error: Password prompt pops up again and forever. VolvoxNo9 Linux - Newbie 4 12-23-2010 09:31 PM
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 01:27 AM
wireless LAN problems, eth0 Guilherme Linux - Newbie 2 03-28-2007 09:32 PM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 06:57 PM
Firewall WAN eth0 LAN eth1 self-bridges, eth0 does all routeing. Nichole_knc Linux - Networking 5 07-29-2004 03:33 PM


All times are GMT -5. The time now is 09:10 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration