linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Ferrari <fluca1978@virgilio.it>
To: linux-admin@vger.kernel.org
Subject: problem with iptables - wrong rules?
Date: Tue, 13 Jul 2004 18:50:55 +0200	[thread overview]
Message-ID: <200407131850.55496.fluca1978@virgilio.it> (raw)

Hi,
this is the situation:
192.168.1.7 linux firewall with eth0 on internet and eth1 on intranet
192.168.1.8 router for internal networks (192.168.4.0,192.168.2.0,ecc.)
The firewall is the main gateway of the whole network, so packets are sent to 
it and redirected to the internet or the other router (192.168.1.8).
I'd like to block connections to everything that is going to the router 
192.168.1.8 excepts for certain machines, thus I've defined the following 
rules:

$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.1.8 -s 192.168.1.30 -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.1.8 -s 192.168.1.37 -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.1.8 -s 192.168.1.64 -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.1.8 -s 192.168.1.3  -j ACCEPT
$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.1.8 -s 0/0 -j DROP


but it is not working, and I can connect from other machine trhu 192.168.1.8. 
In the OUTPUT chain packets should be already be natted, thus my doubt is 
that the destination address is the final one (e.g., 192.168.4.100) and not 
the router one. Is there a way to lock the traffic to the router using 
iptables?

Thanks,
Luca
-- 
Luca Ferrari,
fluca1978@virgilio.it

             reply	other threads:[~2004-07-13 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 16:50 Luca Ferrari [this message]
2004-07-14  7:36 ` problem with iptables - wrong rules? Miguel González Castaños
2004-07-14  8:13   ` Luca Ferrari
2004-07-14  9:33     ` Miguel González Castaños
2004-07-14  9:34       ` Miguel González Castaños
2004-07-14  9:54 ` urgrue

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=200407131850.55496.fluca1978@virgilio.it \
    --to=fluca1978@virgilio.it \
    --cc=linux-admin@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).