Re: Auto-killing connections when changing IP?



Stefan Monnier <monnier@xxxxxxxxxxxxxxxx> writes:

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?

When it is brought down all tcp connections die. HOwever, the programs on
the two ends may well try again.
Ie, just because the network is brought down does not mean that say ssh
dies or something-- why should it? It will simply send out more packets.

The machine at the other end may or may not get upset when it suddenly sees
packets arive from a different IP.
But that is clearly not under your control.


Try an iptables -t nat ... -j MASQUERADE rule

Where... on the router? I have no control on the router(s).

... on my laptop? I have no `nat' table on my laptop (my iptables are 100%
empty).


Stefan
.



Relevant Pages

  • Re: Auto-killing connections when changing IP?
    ... Stefan Monnier wrote: ... interface `foo' whenever this interface is brought up with an IP address ... Try an iptables -t nat ... ...
    (comp.os.linux.networking)
  • Re: 7.0 wishlist?
    ... The "auto-implement" is intended mainly for the odd situation where an existing class you can't edit fits some interface and you're willing to take responsibility for it if it turns out not to actually adhere to the contract, and try using it where that interface type is expected. ... If reference declarations started showing up with the odd asterisk, bang, or other punctuation mark on it, but never primitive declarations, people would probably be able to guess what was going on, on the basis of "what other binary flag might be set on references but not primitives and would be really useful besides can be/cannot be null?" ... the compiler cannot prove by static analysis that the RHS isn't null might be a good idea. ... Object foo, bar; ...
    (comp.lang.java.programmer)
  • Re: Design question - methods calling methods
    ... time I've spent writing Java - I started in 1997 but had a 4 year gap ... A class can implement an interface - that is, it is a subtype of the ... public void fooishBehavior; ... public class FooImpl implements Foo ...
    (comp.lang.java.programmer)
  • Re: we have a "this" keyword, but what if... we also had "component" keyword??
    ... > Now client depends on MyPackage component which serves as a facade. ... But each of these is a standalone object with its own interface. ... responsibilities a Facade object has is re-dispatching messages. ... one of my problems with the original example for Component is that [Foo] ...
    (comp.object)
  • Re: 7.0 wishlist?
    ... This is a slight modifier that would be very common on reference declarations, so it would be good to economize on typing or visual clutter where it was used. ... which has the enum constants actually singleton instances of same-named subclasses. ... enum Foo ... The point being to allow to publish an interface ...
    (comp.lang.java.programmer)