Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: Is this config OK, plus where should I be logging...
Date: Sun, 4 Apr 2004 18:56:26 +0100	[thread overview]
Message-ID: <200404041856.26377.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <000401c41a6a$056c3690$0464a8c0@stu>

On Sunday 04 April 2004 6:26 pm, Stuart Lamble wrote:

> Is this config OK, plus where should I be logging...

We need a bit more information in order to answer either of those questions.

Two things we need to know which you haven't said are:

1. What services are supposed to be allowed from/to where, so we can comment 
on whether this ruleset does what you want it to?

2. What would you like to have logged, so we can advise where to do the 
logging?

Also a few more questions added at points through your ruleset:

> :INPUT DROP [0:0]
> :FORWARD DROP [0:0]
> :OUTPUT DROP [0:0]
>
> -A INPUT -i lo -j ACCEPT
> -A INPUT -i eth1 -j ACCEPT

What is interface eth1 used for?   (We don't know if it's reasonable to accept 
all packets from there into the firewall - we can assume, but that wouldn't 
be an answer to your question.   Do you have only a single trusted machine 
there?   Do you have lots of machines with possibly trusted, possibly 
untrusted users?   Is it connected to the Internet?   We need more info....)

> -A INPUT -p icmp -j ACCEPT
> -A INPUT -p tcp -m tcp --sport 25 -j ACCEPT

Your firewall machine in running a mail client !?

> -A INPUT -i ppp0 -p tcp -m tcp --dport 22 -j ACCEPT
> -A INPUT -i ppp0 -p tcp -m tcp --dport 25 -j ACCEPT

Your firewall machine is running a mail server !!!???

> -A INPUT -i ppp0 -p tcp -m tcp --dport 80 -j ACCEPT
> -A INPUT -i ppp0 -p tcp -m tcp --dport 443 -j ACCEPT
> -A INPUT -i ppp0 -p tcp -m tcp --dport 10000 -j ACCEPT

What's that supposed to be for?

> -A INPUT -i ppp0 -p udp -m udp --sport 53 -j ACCEPT
> -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
> -A FORWARD -s 192.168.100.0/255.255.255.0 -j ACCEPT

That's a nice way to allow spoofed packets through your firewall....

> -A FORWARD -d 192.168.100.6 -p tcp -m tcp --dport 22 -j ACCEPT
> -A FORWARD -d 192.168.100.6 -p tcp -m tcp --dport 7783 -j ACCEPT

What's that for?

> -A OUTPUT -s 127.0.0.1 -j ACCEPT
> -A OUTPUT -o eth1 -j ACCEPT
> -A OUTPUT -p tcp -m tcp --sport 80 -j ACCEPT

You allowed in packets addressed to ports 80 and 443 - how come you only allow 
out reply packets from 80?

> -A OUTPUT -p tcp -m tcp --sport 25 -j ACCEPT
> -A OUTPUT -p tcp -m tcp --sport 22 -j ACCEPT

You allowed in packets to port 10000 - you don't allow the replies out again?

> :PREROUTING ACCEPT [10:1191]
> :POSTROUTING ACCEPT [1:48]
> :OUTPUT ACCEPT [0:0]

So, you set up a nice default DROP policy, added some ACCEPT rules allowing 
the traffic you want, and then change the policy to ACCEPT so that everything 
is allowed (and you don't have any DROP rules).   You may as well not bother 
with the OUTPUT ACCEPT rules - it's all going to get ACCEPTed anyway.

> -A PREROUTING -i ppp0 -p tcp -m tcp --dport 555 -j DNAT --to-destination
> 192.168.100.6:22
> -A PREROUTING -i ppp0 -p tcp -m tcp --dport 7783 -j DNAT
> --to-destination 192.168.100.6:7783
> -A POSTROUTING -s 192.168.100.0/255.255.255.240 -o ppp0 -j MASQUERADE

You seem confused about your network size.   Here you've used a 20 bit netmask 
- earlier you used a 24 bit (on the FORWARDing rule).   Probably best to be 
consistent (what subnet mask are you using on the eth1 interface, and on the 
client machines?)

Also, by the way, what happened to interface eth0?

Regards,

Antony.

-- 
90% of networking problems are routing problems.
9 of the remaining 10% are routing problems in the other direction.
The remaining 1% might be something else, but check the routing anyway.

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-04-04 17:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-04 17:26 Is this config OK, plus were should I be logging Stuart Lamble
2004-04-04 17:56 ` Antony Stone [this message]
2004-04-04 18:41   ` Is this config OK, plus where " Stuart Lamble
2004-04-04 19:07     ` Antony Stone
2004-04-05  5:46       ` Stuart Lamble
2004-04-05  9:11         ` Antony Stone
2004-04-05 13:14           ` Unknown, Alistair Tonner
     [not found]           ` <200404050914.19563.Alistair Tonner <>
2004-04-05 13:34             ` Antony Stone
2004-04-05 13:48               ` Antony Stone

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=200404041856.26377.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox