If Ubuntu is connected to more than one network (e.g. GSM and wireless) but only GSM has internet access, OS is unable to access internet. NM version 0.7.

Bug #278485 reported by Luke12
This bug affects 4 people
Affects Status Importance Assigned to Milestone
network-manager (Ubuntu)
Fix Released

Bug Description

Using NM 0.7 in Hardy (via ppa). I stumbled upon this bug as I am currently without DSL access and have to resort to my GSM connection (through a vodafon modem). The wireless network also allows me to access other computers in the network, so even without internet access it can be useful.
NM is able to handle both connections flawlessly, one at a time. However, if I try to stay connected to both, I am unable to have internet access. Considering that the tray icon status indicates connection to the wireless network, I am inclined to think that NM considers the wireless network more reliable by default and tries to connect to the internet ONLY through it. As this program manages all connections in the OS, this means that every program (including even cli ones such as ping and traceroute) try to reach the net only using the wireless, and local only, network.

As soon as I disable wireless access, I am able to reach the web - even if the modem had been connected to the GSM network all the time.

This could stem from the fact that AFAIK NM is unable to determine if a connection is local only or instead provides internet access.

Desired behaviour: the same I get in Windows Vista. Its connection manager is able to determine whether a connection is local only or provides internet access (maybe pinging some servers or the DNS server?). Moreover, if I connect to two networks at the same time, as in the example above, it can correctly determine which one is functional. Therefore, the user is able to stay connected to more than one network at a time and still have internet access.

Revision history for this message
Motin (motin) wrote :

I can confirm this behavior on two Intrepid RC machines.

I guess the reason is that the 3g connection doesn't replace the default route upon connection. Adding an option like "Replace default route upon connection" (or preferably "Use this connection to access Internet through while connected") to the network connection options and the configuration guide would solve this issue.

Currently, the only way to gain internet access through a gsm connection in nm is to disconnect from wired and wireless networks and then connect...
(There may be some way to accomplish this by modifying the ipv4 routes settings for the connection, but I wouldnt even dare guess how.)

Changed in network-manager:
status: New → Confirmed
Revision history for this message
Motin (motin) wrote :

The workaround I currently use when being connected to my 3g connection and another one at the same time is to replace the default route through the command line:

sudo route add default gw `ip addr show ppp0 | grep inet | head -n 1 | awk '{print $2}' | sed -r 's/\/.*//'` ppp0

Then, as long as I have my 3g providers DNS servers specified in /etc/resolv.conf, I can connect as usual, share my internet connection through Firestarter etc.

Revision history for this message
Alexander Sack (asac) wrote :

you should be able to setup custom connections with non-default routes for your "non" default connections. is that ok?

Revision history for this message
Motin (motin) wrote :

That would be a workaround as well, so no, it is not enough. How many of the average users would understand that?

I am still opting for that simple menu, where the default connection is switched as needed...

Recently, I discovered the following in the logs:

When only connected through GSM connection:
NetworkManager: <info> Policy set 'My GSM Operator' (ppp0) as default for routing and DNS.

When also connected wirelessly:
NetworkManager: <info> Policy set 'My Wlan SSID' (wlan0) as default for routing and DNS.

Being able to change this policy easily ought to be the way to solve this bug, but which "Policy" is this? Is there a simple GUI way of changing it? Is there any way of changing it?

Revision history for this message
Christian González (droetker) wrote :

It should be easy to tell the os which of the Conections is the actual default internet connection. Where's the problem with that?
ATm when connected to two networks it often happens that Ubuntu sets the wrong one as default route - and internet is gone. Why?

Connection sharing in XP is easy since the year 2000. That are 8 years - I would really like to mention that in Linux/Ubuntu so many things like this here simply don't work, bu instead of that new compiz effects are implemented...
You can be connected to more than one networks since Intrepid, but you can't have one of them shared.
(Besides other things like sharing folders *easily*)


Revision history for this message
Alexander Sack (asac) wrote :

One more or less straight foward way would be to never use a default route prio lower than the current lowest route ... this would enforce that previously used default route would still be the default route when more devices become active.

Another fine tuning would allow the user to enforce default route by clicking on the network ... e.g. if NM auto-connects to lets say wirelss while you are connected to GSM it will keep GSM default route the default; but if oyu explicitly connect/click on the wireless it would take over the default route.

Changed in network-manager:
status: Confirmed → Triaged
Revision history for this message
Motin (motin) wrote :

Short version:
The correct way in the latest versions of network manager is to mark which connections that should be evaluated as default connections in the connections editor. Marking as Fix Released.

Long version:
To my surprise (and maybe because of bad coverage in documentation, since it seems many people have had this problem and fine-combed google to find a solution), there exists an option that solves this bug in my case, where it only is a problem at home when connecting to my local wireless network in order to share my internet connection, access printer etc (ie not connecting to the internet):

In network manager connections editor: Wireless -> Mark my local connection -> Edit -> IPv4 Settings -> Routes -> Use this connection only for resources on its network (If enabled, this connection will never be used as the default network connection)

This is a new feature since I started experiencing this issue, so I am marking this bug as Fix Released and instead opening up new bugs for our improvement suggestions.

Some new bugs just reported, in order to improve network manager to be more intuitive and flexible on this point:
Bug #366774 - Please add new sub-menu "Set default connection" in nm-applet menu with the current active connections, so that default route+DNS can be changed easily
Bug #366777 - If the current connection provides internet access, don't change default connection when more device connections become active (Requires that bug #278488 is fixed first though)

Then, of course, some documentation / wiki entries about this would not hurt!

Changed in network-manager (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Motin (motin) wrote :

As a follow-up on my original message from october 2008:

> Adding an option like "Replace default route upon connection" (or preferably "Use this connection to access Internet through while connected") to the network connection options and the configuration guide would solve this issue.

Instead, we have a "opposite" option. I feel it would be more intuitive to change the existing option to a checked-by-default option named "Use this connection as default connection (to access Internet) upon connect".

Then of course, there is the problem of that when there are two "default" connections, network manager seemingly randomly but consistently chooses the wrong one as the de facto default route to use...

Hoping on the two requested features come in later versions...

Revision history for this message
John Moser (nigelenki) wrote :

Plugging in a physical etherenet cable kills internet. Checking all those funny boxes you mentioned for the eth* connection does nothing, it still gets used as default route over wireless.

Changed in network-manager (Ubuntu):
status: Fix Released → New
Revision history for this message
John Moser (nigelenki) wrote :

... because network-manager segfaluts. ok.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Setting back to Fix Released -- Motin is correct, the "Use this connection..." is what should be checked to achieve the expected behavior.

If you're still getting issues or segfaults, please file a separate bug report so we can fix those. Thanks!

Changed in network-manager (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers