Auto-killing connections when changing IP?




I almost always have SSH sessions open when I'm using my laptop, and they
tend to suffer from the following problem: if I suspend the laptop and wake
it up elsewhere, those sessions are still up but unusable: they freeze
because the TCP connection can't be used anymore since the machine has
a different IP number.

The fact that the TCP connections are preserved is good occasionally
(typically when I don't move the laptop so I reconnect to the same DHCP
server which gives me the same IP so the TCP connections can keep on working
(tho if the router does NAT it may have forgotten about that TCP
connection and it still freezes)).
But usually, it's annoying more than anything else, because I have to go and
kill the processes explicitly/manually.

Is there some way to kill all TCP connections that go over the network
interface `foo' whenever this interface is brought up with an IP address
different from the one it had before?


Stefan
.



Relevant Pages

  • Re: TCP Connections to a Broadcast Address on BSD-Based Systems
    ... with the subject 'TCP Connections to a Broadcast Address on ... The NetBSD Security-Officer Team is putting additional tools in place to ... Use rules like these for the case where fxp0 is the interface you desire ...
    (Bugtraq)
  • RE: Can I shut down individual TCP connections?
    ... Can I shut down individual TCP connections? ... and I wanted to kill the andybent.com session. ... of the existing TCP sessions without affecting the others? ... tweaked nt which is what xp home edition is... ...
    (Focus-Microsoft)
  • Re: Killing a network connection
    ... to kill some of the TCP connections visible ... network interfaces up&down with different IP addresses (typically the wlan0 ... I'd like a way to just close TCP connections which are misbehaving in some way, not necessarily due to bad intent. ...
    (Linux-Kernel)
  • Re: Routing problem
    ... It used to pick a random interface/IP for TCP connections that were ... each interface to be in its own interface group? ... What in the system associates a "reply packet" with an incoming packet? ...
    (comp.unix.solaris)
  • RE: Can I shut down individual TCP connections?
    ... Can I shut down individual TCP connections? ... I'd like to be able to terminate particular TCP sessions and not affect ... and I wanted to kill the andybent.com session. ... tweaked nt which is what xp home edition is... ...
    (Focus-Microsoft)