LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 01-11-2012, 03:30 PM   #1
Windows Or Linux
LQ Newbie
 
Registered: Jan 2012
Location: France
Distribution: Debian
Posts: 9

Rep: Reputation: Disabled
Debian-Gnome: Cannot have Network Manager switching between Wire and Wireless


I've read on many issues in that area, but not exactly mine. What I consider normal for the NM is to connect to whatever network is available, but only to one, with some priority given to ethernet compare to wireless.

This behavior is better described in this Ubuntu page.

Too bad I use Debian Squeeze and Gnome. It seems next release of Gnome NM will do that, but not the current one delivered with Squeeze.

What I see on my machine is:

- connect auto to wireless only, and also disconnect auto
- never connect to wire because this eth0 inteface is listed in /etc/Network/interfaces. All interfaces listed here will not be managed by the manager unless there is a setting managed=true for it in /etc/NetworkManager/nm-system-settings.conf.
- if the setting true is provided (I don't know what it means for other aspects, there should be other disavantages, or it would be true by default...) then the wired interface can connect, but there is no mutual exclusion between it and the wireless, so both are active at the same time. Hey is that supposed to be the normal behavior when connecting a PC to the LAN... using every possible connection?

So to summarize:

- why there is no auto management of the ethernet interface?
- why is there no mechanism to keep only one link active, with the preference for wired when available.

I have a thinkpad, and under windows it works like a charm using the drivers provided by Lenovo.


As I'm a newcomer in the Linux world, I may be completely wrong, so feel free to correct me and point to pages that explain the Lenovo default behavior under windows is actually replicated for Debian-Gnome.

Thanks.
 
Old 01-16-2012, 12:32 AM   #2
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Linux Mint, XUbuntu
Posts: 218

Rep: Reputation: 24
You need to manage your connectivity yourself.

Dear WindowsORLinux --

Welcome to LinuxQuestions.

Most questions asked here are of the "how can I accomplish something" variety.
Yours sounds to me like a challenge ... "Why isn't Linux more convenient? Why isn't it like Windows?".
It sounds kind of like a customer service complaint (perhaps I am reading into your post because of your WindowsORLinux
userid implied question)
Linuxquestions users are Linux users, not kernel programmers,
so we cannot justify the design. We also are volunteers, here to help a community of enthusiasts who do
not need to be sold on Linux. We know why we love it, and we'll help others to love it too, but we do not
need to respond to your complaints. If you want to complain go pay Microsoft and complain to them.

Having attempted to inform you of the norms on Linuxquestions. I think now I can probably answer your question regarding how to make Linux do more of what you want. I use Debian squeeze (kernel 2.6.32) on my desktop, but Ubuntu natty
(kernel 2.6.38) on my Lenovo laptop. Because Debian does tend to lag, I usually do not use it on laptops (because
there tend to be more driver hassles and Ubuntu gives you more of the latest and greatest). So ... you might like
Ubuntu more than Debian on your laptop.

On the other hand, I am a real fan of Debian once you've made it work, because it has less eye-candy than
Ubuntu and generally less junk sucking up your system resources. So here is
how I have my Ubuntu laptop configured, and I think it would probably work for you in Debian.

Code:
# /etc/network/interfaces
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
I assume you want dhcp because you sound like you want to connect to "the best network that is around".
My laptop actually uses a static ip address rather than dhcp, and I'd be happy to tell you how to set
that up if it's really what you want. Anyway, as you said, because eth0 is in /etc/network/interfaces, then NM does not try to manage it. However, because it says auto, I find that my computer DOES prefer eth0 to
a wireless connection. This leaves me with the opposite problem to you. When a wireless connection is around (and wired is not), my computer does not know to use wireless instead of wired.

To fix this, I su to root, and then ifconfig eth0 down.
Taking eth0 down reminds the computer to use wlan0
or whatever. There may well be a better way to do this, but I have found the brute force approach provides
me with the flexibility I need. I get eth0 when it's available, and can use wireless hotspots when traveling
if I tell my computer there is no wired connectivity. I re-enable wired with
Code:
/etc/init.d/networking restart
Let me know if this answer works for you.
 
Old 01-17-2012, 07:13 PM   #3
Windows Or Linux
LQ Newbie
 
Registered: Jan 2012
Location: France
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pcardout View Post
It sounds kind of like a customer service complaint (perhaps I am reading into your post because of your WindowsORLinux userid implied question)
Dear pcardout

Fair enough! I must admit my question is not expressed in the way it should be. I apologize. Indeed I don't take the forum community for responsible for Linux design, or anything unpleasant happening to me because of my lack of knowledge. "Windows or Linux", right, I'm fed up of MS unable to improve on XP, and distroying the usability of the GUI in subsequent versions that I continue to buy the high price.

So I'm here to decide if this is the right time for the leap of feath, and to go to Linux. However, on the Linux side, the sky is not either as blue as generally announced. Here is the ranting.

Btw, I currently pays the full price for the full individual license of 7, but -should I be inclined to do so,- asking for support, without paying addl fees, must be done in MS public forums. I see many "tickets" that are closed and marked "solved" and the user still complaining that he/she didn't get a solution.

Despite your feeling of my intent, you have taken time to explain, and to provide a solution, thanks a lot. Let me rephrase:
  • how can I obtain auto management of the ethernet interface?
  • how can I configure the network applet so that only one of the available links can be active at the same time, with the preference for wired?

I changed the content of /etc/network/interfaces as you proposed, here's my file:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

I also have a wire and a wifi connection created in the NM configuration.

After reboot with both cable and wireless available, Gnome NM applet shows the status of wire and wireless:

- eth0 is flagged "not managed", and will never react to plug/unplug
- wifi connects and disconnects automatically as the wireless access point is powered on or off.
- wifi has entries in the applet menu for "connecting" and "disconnecting" it.
- the icon in the top taskbar shows a wireless power scale when wifi is connected, and two computers when not connected.

Removing from Interfaces the lines:
auto eth0
iface eth0 inet dhcp

and rebooting:

- eth0 reacts to plug/unplug
- wifi reacts to wireless AP power on/off as previously
- both types have entries in the applet menu for "connecting" and "disconnecting" them.
- both interfaces can be in the "connected" state at the same time.
- the icon in the top taskbar shows a wired socket when both connections are available or only the wire, the bars when only wifi is available, and the computers when none are available.

The icon seems to reflect what you stated in your case as a priority for wire. I can't confirm that only the connection corresponding to the icon is used when both interfaces are shown "connected" in the applet menu, though I doubt they are "trunked" to use all available bandwidth.

So at this stage I would say that I see what you also see, the cable has the priority over wifi. But to obtain that, I needed to remove the eth0 configuration from etc/network/interfaces.

After one kind of connection has been "disconnected" using the applet menu, then it won't continue to react to availability/unavailability of the cable or radio signal. So the intent of the menu entry is to enable or disable the sensing of the signal, and the automatic use of it if available.

When both signals are available, and I want to use the wifi, then I just need to "disconnect" the wire using the applet menu. I think this is equivalent to what you do with the commands, but using only the applet menu. Seems to be a (very) small improvment compared to your method.

At this stage, provided I didn't "disconnect" manually the interfaces using the applet menu - which actually inhibits the reconnection, I'm happy with:
- the auto reconnection of any interface
- the auto switching from wifi to ethernet when ethernet becomes available

So the key point was to understand the purpose of "disconnect" in the menu, and my problem is indeed solved.

Quote:
Originally Posted by pcardout View Post
Ubuntu gives you more of the latest
Ok.

Last edited by Windows Or Linux; 01-17-2012 at 07:25 PM.
 
Old 01-17-2012, 10:54 PM   #4
pcardout
Member
 
Registered: Jun 2003
Location: Socorro, New Mexico
Distribution: Debian ("lenny", "squeeze"), Linux Mint, XUbuntu
Posts: 218

Rep: Reputation: 24
Your humility is appreciated. Sorry I was kind of crabby. Actually NM itself makes me kind of crabby and it probably rubbed off! I am glad you have a solution of sorts. I learned Linux
before network-manager existed. Let me share some tricks w/ you in case you want to
dump nm entirely. They don't fulfill the "full automation" request you originally made, but
you might find you like having full control over your interfaces and not having to guess
what the NM gods are up to.

Here is a possible /etc/network/interfaces that would not require the existence of
network-manager-gnome (apt-get remove network-manager-gnome ... but not yet!).

Code:
# The primary network interface
#allow-hotplug eth0
#auto eth0
iface eth0 inet dhcp


auto wlan0
iface wlan0 inet dhcp
up /sbin/iwconfig wlan0 mode Managed &&   /sbin/iwconfig wlan0 essid cabernet42
Note the iwconfig commands configure the wifi WITHOUT network manager. The essid
is cabernet42. What if you don't know the essid?

Code:
/home/richard/# iwlist scanning
lo        Interface doesn't support scanning.

eth0      Interface doesn't support scanning.

wlan0     Scan completed :
          Cell 01 - Address: 00:18:39:4E:53:25
                    Channel:3
                    Frequency:2.422 GHz (Channel 3)
                    Quality=54/70  Signal level=-56 dBm  
                    Encryption key:off
                    ESSID:"cabernet42"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s
                    Mode:Master
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 0007636F6479303037
So you can use a command line tool to find the networks around you.

Also the commands:

/sbin/iwconfig wlan0 mode Managed
and /sbin/iwconfig wlan0 essid cabernet42

from your /etc/network/interfaces file can be issued at the command line.
So you can play with the network and see how it all works.

I recommend you read more about Linux networking. It is a large and potentiallyi
complex subject, but the basic commands I've shown you and all the iwconfig commands in
wireless-tools allow you to dump nm entirely and configure the computer the
way you want, when you want.

My post has just enough info to be dangerous, but a little more study and experimenting on
your part would give you a great feeling of competence. The amount of hacking you have
already demonstrated convinces me that you have the right attitude for Linux. You enjoy
engaging your computer!
 
  


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] network manager gnome doesn't display wireless connections Knightron Debian 5 10-16-2011 03:37 AM
Debian 5 Lenny - Network Manager in Gnome is absolutely worthless mtlhd Linux - Networking 3 11-16-2009 01:56 PM
Debian-Gnome: Network Manager Working Strange with Intel wireless 4965AGN sd|| Linux - Wireless Networking 1 11-05-2009 04:09 AM
Wire network is ok but unable to connect to wireless and wireless card is not detect vitalstrike82 SUSE / openSUSE 4 11-01-2007 07:56 AM
wireless network not recognised by network manager gnome linuxmandrake SUSE / openSUSE 1 09-10-2007 05:45 PM


All times are GMT -5. The time now is 10:43 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration