Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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.

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.

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? –  queueoverflow 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. –  queueoverflow Jul 21 '12 at 10:05
add comment

Your Answer

 
discard

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.