Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Diego Lacerda <diegolacerda@gmail.com>
To: Steven Kath <steven.kath@vyatta.com>
Cc: 'sean darcy' <seandarcy2@gmail.com>, netfilter@vger.kernel.org
Subject: RE: does -p udp --dport 5060 not work with -j LOG?
Date: Thu, 01 May 2008 21:45:09 -0300	[thread overview]
Message-ID: <1209689109.6381.20.camel@localhost.localdomain> (raw)
In-Reply-To: <05dd01c8abe6$7a65aa50$5000040a@skathlaptop>

[-- Attachment #1: Type: text/plain, Size: 1961 bytes --]


On Thu, 2008-05-01 at 16:53 -0700, Steven Kath wrote:
> > 
> > There only one line in my script that uses SIP:
> > 
> > grep SIP firewall-masq
> > $IPT -t nat -A PREROUTING -i external -p udp  --dport 5060 -j LOG
> > --log-prefix "SIP-BEFORE:  "
> > 
> > And it's run first:
> > 
> > sh -x firewall-masq
> > + IPT=/sbin/iptables
> > + /sbin/iptables -F
> > + /sbin/iptables -X
> > + /sbin/iptables -t nat -A PREROUTING -i external -p udp --dport 5060 -j
> > LOG --log-prefix 'SIP-BEFORE:  '
> > ...........
> > 
> > 
> > I don't really understand this output:
> > 
> > iptables -L -n -v -t nat | grep SIP
> >      2   262 LOG        udp  --  *      *       0.0.0.0/0
> > 0.0.0.0/0           udp dpt:5060 LOG flags 0 level 4 prefix `SIP-BEFORE:
> > '
> >   144K   24M LOG        udp  --  *      *       0.0.0.0/0
> > 0.0.0.0/0           LOG flags 0 level 4 prefix `SIP-BEFORE:  '
> > 41816 5117K LOG        udp  --  external *       0.0.0.0/0
> > 0.0.0.0/0           LOG flags 0 level 4 prefix `SIP-BEFORE:  '
> >      0     0 LOG        udp  --  external *       0.0.0.0/0
> > 0.0.0.0/0           udp dpt:5060 LOG flags 0 level 4 prefix `SIP-BEFORE:
> > '
> >      0     0 LOG        udp  --  external *       0.0.0.0/0
> > 0.0.0.0/0           udp dpt:5060 LOG flags 0 level 4 prefix `SIP-BEFORE:
> > '
> ...
> 
> It looks like your nat table isn't getting flushed.  
> 
> Have you tried running 'iptables -t nat -F' before firewall-masq or adding
> that to the start of the script?

Yeah,

I think that you really need flush the NAT table before.
In this case you can see that the second and third rules in you NAT table are logging every UDP packet (you can see that by first and second columns: packets/bytes).

Regards,

-- 
Diego Evaristo de Lacerda (diegolacerda@gmail.com)
Project Analyst
LPIC Level III & Redhat Certified Engineer & Cisco Certified Network
Associates

URL: conectado.motime.com

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-05-02  0:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 22:27 does -p udp --dport 5060 not work with -j LOG? sean darcy
2008-05-01  3:23 ` Diego Lacerda
2008-05-01 23:36   ` sean darcy
2008-05-01 23:53     ` Steven Kath
2008-05-02  0:45       ` Diego Lacerda [this message]
2008-05-02  1:10         ` sean darcy
2008-05-02  1:40           ` Steven Kath
2008-05-02 13:34           ` Jan Engelhardt

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=1209689109.6381.20.camel@localhost.localdomain \
    --to=diegolacerda@gmail.com \
    --cc=netfilter@vger.kernel.org \
    --cc=seandarcy2@gmail.com \
    --cc=steven.kath@vyatta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox