Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a laptop which I can put onto a docking station where it is connected to the internet via ethernet (eth0). Otherwise, it is connected via wireless (wlan0).

When I plug in the ethernet cable and disable the wireless, all programs loose internet access (except the browser since it connects every single time).

How can I let all applications have internet access independant of the physical device being used? So that connections are kept alive through the interface change.

share|improve this question
up vote 2 down vote accepted

When an application wants to use the network it asks the OS to open a socket, which is associated with source and destination IP addresses/ports.


An Internet socket is characterized by a unique combination of the following:
Local socket address: Local IP address and port number
Remote socket address: Only for established TCP sockets. As discussed in the client-server section below, this is necessary since a TCP server may serve several clients concurrently. The server creates one socket for each client, and these sockets share the same local socket address.
Protocol: A transport protocol (e.g., TCP, UDP, raw IP, or others). TCP port 53 and UDP port 53 are consequently different, distinct sockets.

When you change your network connection usually you get a different IP address, thus the earlier opened socket becomes invalid for the new connection. You'll only achieve what you want if you find a way to keep the same IP address for both wired and wireless connections.

share|improve this answer
Okay, sounds like this cannot work like I'd like it to. But the server only sees my the IP address of the router, not the one of my computer. But I guess that the router does not realize that I am the same client, just with a different IP address? – Martin Ueding Jul 20 '12 at 21:34
@queueoverflow Exactly. But even if the router could recognize the IP change, the Operating System will not link the already open socket to the new IP address. – Eric Carvalho Jul 21 '12 at 0:51
is there a possibility to keep the IP address? We currently have a plain router with DHCP which will give me a random address for each device. – Martin Ueding Jul 21 '12 at 10:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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