rkellerm
rkellerm

Reputation: 5512

Hold a network connection although IP address change

Is it possible to hold an open TCP connection with a client, while the IP address of the client is externally changed? For example, the connection is establishes against address X, but somewhen while the connection is open, the client-side user asks for IP renew and gets another IP address. Can the connection remains alive in this case?

Thanks in advance.

Upvotes: 2

Views: 288

Answers (3)

Brent81
Brent81

Reputation: 1172

What I know is, when using UDP, the connection can be remained, one of my application is to change a remote network adapter address via UDP.

For TCP, I agree with Soonts, you should design your server and client application to allow the reconnect in a transparent way.

Upvotes: 0

Soonts
Soonts

Reputation: 21946

This is possibe with tcp v6 connections, if you're using e.g. tunnelbrocker.net. Every time your IPv4 address changes, the connection between your IP4 address and the tunnelbrocker's IP4 address is dropped then re-established, however your IP6 attress is the same and all the TCP/IPv6 conections from your IP6 address to your destination IP6 addresses are still here.

Or, if you're designinng both your client & server, your could design your protocol allowing the client to reconnect in a transparent way..

Upvotes: 0

MikeyB
MikeyB

Reputation: 3350

No, it cannot.

Even if the local side could be massaged to understand that the connection is suddenly between different addresses, the remote side will not understand and will refuse to work with it.

You'd need to re-add the old IP address to continue using the connection.


To do so:

Linux: ip addr add 172.16.10.20/22 dev bond0
Windows: do some pointy-clicky or**fill in command here**

Upvotes: 3

Related Questions