GNOME Bugzilla – Bug 653789
Give user the option to select which connection to use for IPv4/DNS
Last modified: 2012-07-25 13:43:17 UTC
Last week, I posted this on http://ubuntuforums.org/showthread.php?t=1790528 and also to the networkmanager list. Having received no reply I go ahead and post it on the bugzilla. I'm running Kubuntu Natty. As I have no broadband connection at home [:(] I have to connect to the net via my Nokia C5 mobile phone and a Vodafone 2G connection. Thankfully Natty automatically detects my phone when it is plugged in in the correct mode and using a wizard enables me to connect. However, I also have an ethernet/wireless router connecting my two laptops and desktop via ethernet cable. The problem is that when I connect to my local home network via ethernet or wireless, the dialup mobile internet connection gets disabled. See the below behaviour when I disconnect and then reconnect my ethernet (similar thing happens for wireless too): $ dmesg | tail [ 21.364609] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory [ 21.377712] NFSD: starting 90-second grace period [ 22.383233] acer_wmi: Acer Laptop WMI Extras unloaded [ 28.389718] PPP BSD Compression module registered [ 28.429614] PPP Deflate Compression module registered [ 232.247075] r8169 0000:03:00.0: eth0: link up [ 232.247730] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 242.382351] eth0: no IPv6 routers present [ 329.914179] r8169 0000:03:00.0: eth0: link down [ 340.164564] r8169 0000:03:00.0: eth0: link up $ tail /var/log/syslog Jun 25 09:53:52 sarvajnatma NetworkManager[873]: <info> Scheduling stage 5 Jun 25 09:53:52 sarvajnatma NetworkManager[873]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) scheduled... Jun 25 09:53:52 sarvajnatma NetworkManager[873]: <info> Done scheduling stage 5 Jun 25 09:53:52 sarvajnatma NetworkManager[873]: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete. Jun 25 09:53:52 sarvajnatma NetworkManager[873]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) started... Jun 25 09:53:53 sarvajnatma NetworkManager[873]: <info> Policy set 'Vodafone - Vodafone Connect' (ppp0) as default for IPv4 routing and DNS. Jun 25 09:53:53 sarvajnatma NetworkManager[873]: <info> (eth0): device state change: 7 -> 8 (reason 0) Jun 25 09:53:53 sarvajnatma NetworkManager[873]: <info> Policy set 'Auto eth0' (eth0) as default for IPv4 routing and DNS. Jun 25 09:53:53 sarvajnatma NetworkManager[873]: <info> Activation (eth0) successful, device activated. Jun 25 09:53:53 sarvajnatma NetworkManager[873]: <info> Activation (eth0) Stage 5 of 5 (IP Configure Commit) complete. The problem is evident in the line that says that the policy has been changed to choose the ethernet connection for IPv4 routing and DNS when it is plugged in, probably because NM assumes that ethernet would give greater speeds than dialup. The problem is that my ethernet (and wireless) isn't connected to the internet at all but only the dialup is! I find no option by which to change the default for IPv4 routing and DNS back to my mobile internet connection. I checked the Kubuntu NM tray applet and also the manpages for NetworkManager et al. As mentioned at the outset, I've also asked on the networkmanager mailing list. Having no replies I assume that NM currently doesn't have a manual override to select which connection to use for IPv4 routing and DNS. Please provide such a facility because there well may be others in a situation similar to mine. Thanks!
Right-click the NM icon -> Edit connections -> select your wired (wireless) connection -> Edit -> IPv4 Settings -> Routes... -> check "Use this connection only for resources on it's own network" That will prevent the interface from having the "default gateway" when the connection is activated. Thus global traffic will go through your 3G connection. Note: You can see default gateway via $ ip route or $ route
Hey this is great! I tested this out and I could ping to my other laptop and mount an NFS share from it while connected to the internet! On my KDE system I located it thus: NM tray icon > Network Management Settings > Wired/Wireless > {MyLocal[Wired|Wireless]Connection} > Edit > IP Address > Routes (from combobox that shows Basic Settings) > Use only for resources on this connection Why is this not enabled by default? If there is a reason, does it mean that this bug should be closed? What does "resources on this connection" exactly mean and how is it determined? (I realize this is not a forum but just a simple explanation would do.)
Resources on this connection means default route won't be set. It can't be the default as users need default routes, it must be configured manually.