All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Musketa <Daniel@musketa.de>
To: netfilter@lists.netfilter.org
Subject: Re: [MASQUERADING] iptables keeps sending from old IP after ppp0's IP has changed
Date: Wed, 30 Aug 2006 15:47:47 +0200	[thread overview]
Message-ID: <200608301547.47896.Daniel@musketa.de> (raw)
In-Reply-To: <Pine.LNX.4.61.0608301500440.4610@yvahk01.tjqt.qr>

Am Mittwoch, 30. August 2006 15:01 schrieb Jan Engelhardt:
> >Every night the router's ppp0 goes down and after about a minute up again
> > with a new IP. But iptables keeps on sending the NATted UDP packets
> > _from_ the old IP address. `iptables -F` and reloading the rules doesn't
> > help. The only workaround is to stop asterisk on the NAT client for about
> > 2 minutes.
[...]
> >How can I force iptables to use ppp0's real IP address as sender IP in
> >outgoing packets?
>
> Flush the conntrack table when ppp0 has gone up (yes, up)

Is there a cleaner way than

#!/bin/sh
TIMEOUT=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout)
TIMEOUT_STREAM=$(cat /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream)
	
echo 0 > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout
echo 0 > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream

sleep 10

echo ${TIMEOUT} > /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout
echo ${TIMEOUT_STREAM} 
> /proc/sys/net/ipv4/netfilter/ip_conntrack_udp_timeout_stream

#EOF

?

Daniel


      parent reply	other threads:[~2006-08-30 13:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-30 12:07 [MASQUERADING] iptables keeps sending from old IP after ppp0's IP has changed Daniel Musketa
2006-08-30 13:01 ` Jan Engelhardt
2006-08-30 13:25   ` Pascal Hambourg
2006-08-30 13:57     ` Jan Engelhardt
2006-08-30 13:47   ` Daniel Musketa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200608301547.47896.Daniel@musketa.de \
    --to=daniel@musketa.de \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.