2

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.

1 Answer 1

2

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.

Wikipedia:

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.

3
  • 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? Jul 20, 2012 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. Jul 21, 2012 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. Jul 21, 2012 at 10:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .