Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If the question isn't clear enough, consider this situation:

  1. Establish a TCP/IP connection from computer C to server X
  2. Change the default gateway (of computer C) from gateway A to gateway B (both gateways can reach server X)

Now, which gateway will the packets go through? If it depends on the OS, please tell me the behavior of Windows and Linux.

share|improve this question
1  
Wouldn't that depend on the opsys? Some will begin to use the new gateway as soon as you save your changes; others will require a reboot first. Or are you making these changes on a router rather than a workstation? –  goblinbox Mar 8 '10 at 3:20
    
If you have a workstation on a subnet that has two gateways available that route to the same place, don't you have one too many gateway? :) –  MDMarra Mar 8 '10 at 4:13

1 Answer 1

up vote 5 down vote accepted

Assuming that the OS network stack applied the change immediately, then the packets will go through the current gateway.

The default route, and routing in general, is IP only and IP is stateless. It is just a packet mover. That is it gets a packet from IP A to IP B. There is no state stored between packets, that's for TCP.

TCP doesn't care what route it takes, the TCP state is based on the source IP/Port and destination IP/Port so your TCP connections should not be interrupted. That is unless your gateway is a NAT and changing gateways makes the IP packet go through another NAT.

The true test of this question would be to setup the set up the scenario and see what happens, but I assume you are asking out of curiosity.

share|improve this answer

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.