1

I have an old laptop with Ubuntu 14 with LXDE windows manager . I use it to connect by RDP through a crossover cable to a more powerful desktop. The problem is I have to disconnect the wireless network to connect to the crossover and the other way around.

Why is this happening and how could I connect to both networks in the same time so I can use both RDP and internet in the same time?

ifconfig output:

eth0      Link encap:Ethernet  HWaddr 88:ae:1d:e7:64:20  
          inet addr:172.16.0.2  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: fe80::8aae:1dff:fee7:6420/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8622 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8558 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4629232 (4.6 MB)  TX bytes:658519 (658.5 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:207 errors:0 dropped:0 overruns:0 frame:0
          TX packets:207 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:26007 (26.0 KB)  TX bytes:26007 (26.0 KB)

wlan0     Link encap:Ethernet  HWaddr e8:39:df:c2:62:32  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

route output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
172.16.0.0      *               255.255.0.0     U     1      0        0 eth0

Edit 2:

Ok , I added a few testing results. (It seems to me that a network only works if the other one is disconnected first.)

Step 1:

I had wifi on (secured), could connect to internet . I added ethernet for crossover cable 172.16.0.2 with 0.1 gateway and browser wouldn't open pages anymore. Instead Remmina worked . Both networks have "automatically connect".

Here are the outputs : -ifconfig output:

eth0      Link encap:Ethernet  HWaddr 88:ae:1d:e7:64:20  
      inet addr:172.16.0.2  Bcast:172.16.255.255  Mask:255.255.0.0
      inet6 addr: fe80::8aae:1dff:fee7:6420/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:815838 errors:0 dropped:0 overruns:0 frame:0
      TX packets:110466 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1182391539 (1.1 GB)  TX bytes:7532232 (7.5 MB)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:795 errors:0 dropped:0 overruns:0 frame:0
      TX packets:795 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:78363 (78.3 KB)  TX bytes:78363 (78.3 KB)

wlan0     Link encap:Ethernet  HWaddr e8:39:df:c2:62:32  
      inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::ea39:dfff:fec2:6232/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:980 errors:0 dropped:0 overruns:0 frame:0
      TX packets:783 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:532942 (532.9 KB)  TX bytes:101473 (101.4 KB)

-route output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
172.16.0.0      *               255.255.0.0     U     1      0        0 eth0
192.168.1.0     *               255.255.255.0   U     9      0        0 wlan0

Step 2:

I deleted wifi network and still could connect to ethernet. I added wifi and it said connected to wifi but browser still doesn't open pages and Remmina works and in network connections last used is never.

Here are the outputs.

-ifconfig output:

eth0      Link encap:Ethernet  HWaddr 88:ae:1d:e7:64:20  
      inet addr:172.16.0.2  Bcast:172.16.255.255  Mask:255.255.0.0
      inet6 addr: fe80::8aae:1dff:fee7:6420/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:816264 errors:0 dropped:0 overruns:0 frame:0
      TX packets:110792 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1182726153 (1.1 GB)  TX bytes:7564121 (7.5 MB)

lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:1083 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1083 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:96542 (96.5 KB)  TX bytes:96542 (96.5 KB)

wlan0     Link encap:Ethernet  HWaddr e8:39:df:c2:62:32  
      inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::ea39:dfff:fec2:6232/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1283 errors:0 dropped:0 overruns:0 frame:0
      TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:606528 (606.5 KB)  TX bytes:118874 (118.8 KB)

-route output:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.16.0.1      0.0.0.0         UG    0      0        0 eth0
172.16.0.0      *               255.255.0.0     U     1      0        0 eth0
192.168.1.0     *               255.255.255.0   U     9      0        0 wlan0

Step 3: Delete both networks and add them with no "automatic connect"

Now Remmina doesn't connect and browser doesn't open pages.

outputs:

ifconfig:

eth0      Link encap:Ethernet  HWaddr 88:ae:1d:e7:64:20  
      inet6 addr: fe80::8aae:1dff:fee7:6420/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:816272 errors:0 dropped:0 overruns:0 frame:0
      TX packets:110821 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:1182726833 (1.1 GB)  TX bytes:7568985 (7.5 MB)

 lo        Link encap:Local Loopback  
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:1199 errors:0 dropped:0 overruns:0 frame:0
      TX packets:1199 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:103618 (103.6 KB)  TX bytes:103618 (103.6 KB)

wlan0     Link encap:Ethernet  HWaddr e8:39:df:c2:62:32  
      inet6 addr: fe80::ea39:dfff:fec2:6232/64 Scope:Link
      UP BROADCAST MULTICAST  MTU:1500  Metric:1
      RX packets:1354 errors:0 dropped:0 overruns:0 frame:0
      TX packets:902 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:626408 (626.4 KB)  TX bytes:119432 (119.4 KB)

route:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

Thank you for taking the time to read this.

  • Please, add output from command ifconfig and route in question. – 2707974 Mar 18 '15 at 7:35
  • Can you please re-run those two commands while connected through both wired and wireless network, as that is the problematic configuration? – David Foerster Mar 18 '15 at 13:36
2

Under default setting, Ubuntu prefer eth0 than wlan0. So when both network interfaces are active, your system use eth0 to connect internet even if internet is inaccessible from eth0.

One solution is to edit the configuration on your desktop. In the end, run sudo iptables -t nat -L in your desktop you should see something similar to

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination         
MASQUERADE  all  --  10.0.3.0/24         !10.0.3.0/24

where 10.0.3.0/24 should be the subnet connecting to your laptop.

I would recommend another solution, which is to let Ubuntu prefer wlan0 than eth0. One easy approach is using network-manager package, choose "Edit Connection", Edit Connections or run nm-connection-editor. Then "Add" a new connection for ethernet, configure ip address, gateway, etc normally.

IPv4 Setting Then click "Routes..." under "IPv4 Settings" page (and under "IPv6 Settings" page)

Routes Click the box saying "Use this connection only for resources on its network".

Choose connection Finally, choose the correct connection, my connection is named by "USRP". Therefore Ubuntu knows limited resources is accessible via this Ethernet, so it would route all the internet traffic via WiFi.

All above is tested in Ubuntu 14.04 to 15.04 and gnome/unity desktop manager. I think it should also work for LXDE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.