public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Pandu Poluan <pandu@poluan.info>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] IPTABLES syntax change?
Date: Thu, 3 Jan 2013 10:57:09 +0700	[thread overview]
Message-ID: <CAA2qdGVm2bBzh8kgqHh5U-pt=RuFzj5PTeF+F1JjWsNqoiwqrw@mail.gmail.com> (raw)
In-Reply-To: <50E4A857.1090800@orlitzky.com>

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

On Jan 3, 2013 4:40 AM, "Michael Orlitzky" <michael@orlitzky.com> wrote:
>
> On 12/30/12 22:21, Walter Dnes wrote:
> >   OK, here is version 2.  I had "an excellent adventure" along the way.
> >
>
> I'm doing the upgrade on our servers right now, and there's another
> possible gotcha: the newer iptables (requiring conntrack) requires
> NETFILTER_XT_MATCH_CONNTRACK support in the kernel. This is in contrast
> to the state matches which used NETFILTER_XT_MATCH_STATE.
>
> To minimize downtime during the switch, I'm doing,
>
>   1. Rebuild the kernel, enable conntrack and disable state.
>
>   2. Fix my iptables-config script to use the conntrack stuff
>
>   3. Create a dummy set of rules that allows me to SSH in (without
>      state matching)
>
>   4. Run and save those rules
>
>   5. Reboot to new kernel
>
>   6. SSH in and run iptables-config
>
>   7. Save the rules
>
>
> > [0:0] -A INPUT -s 192.168.123.248/29 -i eth0 -j ACCEPT
> > [0:0] -A INPUT -s 169.254.0.0/16 -i eth0 -j ACCEPT
> > [0:0] -A INPUT -i lo -j ACCEPT
> > [0:0] -A INPUT -m conntrack --ctstate INVALID,NEW -j UNSOLICITED
> > [0:0] -A INPUT -p tcp -m multiport --dports 0:1023,6000:6063 -j
BAD_DPORT
> > [0:0] -A INPUT -p udp -m multiport --dports 0:1023,6000:6063 -j
BAD_DPORT
> > [0:0] -A INPUT -s 69.63.176.0/20 -j FECESBOOK
> > [0:0] -A INPUT -s 69.220.144.0/20 -j FECESBOOK
> > [0:0] -A INPUT -s 69.63.176.0/20 -j FECESBOOK
> > [0:0] -A INPUT -s 69.171.224.0/19 -j FECESBOOK
> > [0:0] -A INPUT -s 200.58.112.0/20 -j FECESBOOK
> > [0:0] -A INPUT -s 213.155.64.0/19 -j FECESBOOK
> > [0:0] -A INPUT -s 10.0.0.0/8 -j PRIVATE_LOG
> > [0:0] -A INPUT -s 127.0.0.0/8 -j PRIVATE_LOG
> > [0:0] -A INPUT -s 172.16.0.0/12 -j PRIVATE_LOG
> > [0:0] -A INPUT -s 192.168.0.0/16 -j PRIVATE_LOG
> > [0:0] -A INPUT -p icmp -j ICMP_IN
> > [0:0] -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
>
> These rules will be evaluated in order. I have no evidence for this, but
> I suspect you're better off accepting the ESTABLISHED,RELATED stuff
> earlier in the chain so you don't slow down the packets that you want.
>

True. But you will want to filter out 'suspicious' packets beforehand.

In my previous employment, I had a Gentoo-based firewall with more than 100
lines of rules. Plus I also employ 'ipset' to allow on-the-fly manipulation
of blocking/routing.

If you want to see the whole nine yards, I can try asking my replacement to
send me the whole deal.

Rgds,
--

[-- Attachment #2: Type: text/html, Size: 3522 bytes --]

  reply	other threads:[~2013-01-03  3:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-27  0:47 [gentoo-user] IPTABLES syntax change? Walter Dnes
2012-12-27  1:43 ` Michael Orlitzky
2012-12-27 11:28   ` Graham Murray
2012-12-27 16:36     ` Michael Orlitzky
2012-12-27 17:52       ` Matthias Hanft
2012-12-27 19:04         ` Michael Orlitzky
2012-12-27 23:11     ` Walter Dnes
2012-12-27 23:50       ` Michael Orlitzky
2012-12-28  3:59         ` Walter Dnes
2012-12-28  6:07           ` Michael Orlitzky
2012-12-28  6:15             ` Michael Orlitzky
2012-12-29  2:46             ` Walter Dnes
2012-12-29  3:59               ` Kerin Millar
2012-12-29 18:32                 ` Walter Dnes
2012-12-29 18:49                   ` Jarry
2012-12-30 22:42                   ` Michael Orlitzky
2012-12-31  2:55                     ` Adam Carter
2012-12-31  3:21             ` Walter Dnes
2013-01-02 21:36               ` Michael Orlitzky
2013-01-03  3:57                 ` Pandu Poluan [this message]
2013-01-03  4:32               ` Michael Orlitzky
2013-01-04 20:17                 ` Walter Dnes
2013-01-04 20:27                   ` Michael Mol
2013-01-05  1:29                     ` Walter Dnes
2013-01-05  3:26                       ` Michael Mol
2013-01-05 11:57                         ` Mick
2013-01-06 21:54                           ` Walter Dnes

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='CAA2qdGVm2bBzh8kgqHh5U-pt=RuFzj5PTeF+F1JjWsNqoiwqrw@mail.gmail.com' \
    --to=pandu@poluan.info \
    --cc=gentoo-user@lists.gentoo.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