All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Miguel González Castaños" <mgc@tid.es>
To: fluca1978@virgilio.it, linux-admin@vger.kernel.org
Subject: Re: problem with iptables - wrong rules?
Date: Wed, 14 Jul 2004 11:33:08 +0200	[thread overview]
Message-ID: <40F4FDD4.2040807@tid.es> (raw)
In-Reply-To: <200407141013.43424.fluca1978@virgilio.it>

Luca Ferrari escribió:

>On Wednesday 14 July 2004 09:36 Miguel González Castaños's cat walking on the 
>keyboard  wrote:
>
>  
>
>>Hi,
>>
>> I am not sure what is your network architecture but i assume this:
>>
>> You have a LAN connected (lets call it LAN1) to the Internet through
>>the linux firewall (192.168.1.7). This firewall acts also as a router
>>being connected to the 192.168.1.8 router which is connected to
>>different LANs.
>>
>> With the DROP rule you are blocking packets destined to 192.168.1.8 and
>>come from anywhere (in this case Internet and LAN1).
>>
>> I assume when you say have NATTED the connection, you have NATTED
>>connections from LAN1 to the Internet and maybe connections from the
>>other LANs, am I wrong ? (maybe you should give us a picture or more
>>details of what you have in your NAT rules). If so, then LAN1 and the
>>other LANs are routed and not natted among them.
>>
>> Then, you should block destination to network 192.168.2.0, 192.168.4.0,
>>etc...
>>.html
>>    
>>
>
>I believe you're right, since I've natted only packets from/to the internet 
>and not another lan. Anyway, is there a way using iptables to intercepts 
>packets that are going to the 192.168.1.8 router? I'd like to log those 
>packets, but I believe that iptables acts before the kernel routing table, 
>thus it is not easy to intercept those packets.
>Any idea?
>
>Thanks,
>Luca
>
>  
>
you can try using a sniffer in your firewall such as ethereal or 
somethink like that and you could see the packets. Anyway, I suppose 
packets coming from LAN1 to the other LANs will have in the destination 
IP an IP like 192.168.2.x 192.168.4.x , so you have to block packets 
that match this criteria. Something like this (i am writting these rules 
roughly to give you the idea) :

 

$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.2.0 -s 192.168.1.0 -j DROP
$IPTABLES -A OUTPUT -o $INTIF  -d 192.168.4.0 -s 192.168.1.0 -j DROP

I do not know (since i dont know how you are natting) if these rules could block the packets coming from internet to 192.168.2.x, etc...Anyway your setup is a bit weird...Wouldnt be more easy to block these packets in the router for the LANs instead of doing that in the firewall? Why dont you set a different range of IPs for LAN1? I bet it would be much easier...

HTH

Miguel



 
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2004-07-14  9:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 16:50 problem with iptables - wrong rules? Luca Ferrari
2004-07-14  7:36 ` Miguel González Castaños
2004-07-14  8:13   ` Luca Ferrari
2004-07-14  9:33     ` Miguel González Castaños [this message]
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=40F4FDD4.2040807@tid.es \
    --to=mgc@tid.es \
    --cc=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 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.