All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeffrey Laramie <JALaramie@Loudoun-Fairfax.com>
To: netfilter@lists.netfilter.org
Subject: Re: Iptables logging only output packets
Date: Tue, 04 Nov 2003 10:09:22 -0500	[thread overview]
Message-ID: <3FA7C122.2000908@Loudoun-Fairfax.com> (raw)
In-Reply-To: <20031104142344.43912.qmail@web41408.mail.yahoo.com>

James Martin wrote:

>Hi. My problem with Iptables is that it logs only
>outgoing packet, and not incoming ones.
>
>It is set up in a very simple way, more to do packet
>logging/capturing than to do do real firewalling. Its
>main purpose is a didactic one. 
>etho is connected to the Internet, and eth2 goes to
>the LAN (for some strange reasons the additional
>pcmcia ethernet card on the Toshiba laptop is
>recognized as eth1 and not as eth1, but this is fine).
>
>Following is the Iptables script:
>
>clear
>echo "1" > /proc/sys/net/ipv4/ip_forward
>/sbin/iptables -F
>/sbin/iptables --delete-chain 
>/sbin/iptables -t nat --delete-chain
>/sbin/iptables -t mangle --delete-chain
>  
>

You're not actually flushing the nat and mangle tables, you're only 
deleting user defined chains. This is better:

iptables="/sbin/iptables"

# Clear all previous chains.
$iptables -t filter -F
$iptables -t nat -F
$iptables -t mangle -F
$iptables -X

>/sbin/iptables -N entrata
>/sbin/iptables -N uscita
>/sbin/iptables -P INPUT  ACCEPT
>/sbin/iptables -P OUTPUT ACCEPT
>/sbin/iptables -P FORWARD ACCEPT
>/sbin/iptables -t nat -A POSTROUTING -o eth0 -j
>MASQUERADE
>/sbin/iptables -A FORWARD -i etho -o eth2 -j entrata 
>/sbin/iptables -A FORWARD -i eth2 -o eth0 -j uscita 
>/sbin/iptables -A entrata -j LOG --log-prefix
>"Firewall Entr: " --log-level "DEBUG" 
>/sbin/iptables -A uscita -j LOG --log-prefix "Firewall
>Usc: " --log-level "DEBUG" 
>
>What I get is log entries only with prefix "Firewall
>Usc: ", that is outgoing, and not even one packet with
>"Firewall Entr: " prefix.
>
>Any idea of what I am doing wrong ?
>
>Thanks,
>
>James
>
>
>  
>

Not having a valid eth1 interface seems odd. What does ifconfig give you?

Jeff



      reply	other threads:[~2003-11-04 15:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04 14:23 Iptables logging only output packets James Martin
2003-11-04 15:09 ` Jeffrey Laramie [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=3FA7C122.2000908@Loudoun-Fairfax.com \
    --to=jalaramie@loudoun-fairfax.com \
    --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.