All of lore.kernel.org
 help / color / mirror / Atom feed
From: "C. L. Martinez" <carlopmart@gmail.com>
To: netfilter@vger.kernel.org
Subject: Re: Problems with a forward rule
Date: Mon, 14 May 2012 07:45:21 +0200	[thread overview]
Message-ID: <CAEjQA5LAwmxTwAGWJH5A5Bs57h8=BSXWwiWegYmVKSM7ZtvtmA@mail.gmail.com> (raw)
In-Reply-To: <4FAECDBA.9030302@saasplaza.com>

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

On Sat, May 12, 2012 at 10:53 PM, Tom van Leeuwen
<tom.van.leeuwen@saasplaza.com> wrote:
> Indeed do iptables-save for the complete ruleset and tell us what you want
> and expect.
>
>
> On 12-5-2012 17:47, Jan Engelhardt wrote:
>>
>> On Friday 2012-05-11 17:04, C. L. Martinez wrote:
>>
>>> Hi all,
>>>
>>> I have setup the following rules in a centos6 gateway:
>>> [ugly iptables -L]
>>
>> *Use* iptables-save and provide a *full* ruleset.
>>

Ok, here they are. I want to allow connections from host 172.24.50.3
to one specific network only.

[-- Attachment #2: myiptables --]
[-- Type: application/octet-stream, Size: 2903 bytes --]

# Generated by iptables-save v1.4.7 on Mon May 14 07:37:11 2012
*nat
:PREROUTING ACCEPT [398:17466]
:POSTROUTING ACCEPT [52:3232]
:OUTPUT ACCEPT [52:3232]
-A PREROUTING -i prodif -p tcp -m tcp --dport 2222 -j DNAT --to-destination 172.24.50.2:22 
-A PREROUTING -i prodif -p tcp -m tcp --dport 8081 -j DNAT --to-destination 172.24.50.3:8081 
-A PREROUTING -i prodif -p tcp -m tcp --dport 8444 -j DNAT --to-destination 172.24.50.3:8444 
-A PREROUTING -i prodif -p tcp -m tcp --dport 5555 -j DNAT --to-destination 172.24.50.3:3389 
-A POSTROUTING -s 172.24.50.2/32 -o prodif -j MASQUERADE 
-A POSTROUTING -s 172.24.50.3/32 -o prodif -j MASQUERADE 
COMMIT
# Completed on Mon May 14 07:37:11 2012
# Generated by iptables-save v1.4.7 on Mon May 14 07:37:11 2012
*filter
:INPUT DROP [380:16172]
:FORWARD DROP [2:80]
:OUTPUT DROP [0:0]
:BADFLAGS - [0:0]
:SSH - [0:0]
:TCPFLAGS - [0:0]
-A INPUT -p tcp -j TCPFLAGS 
-A INPUT ! -s 172.24.50.0/28 -i siemif -j LOG --log-prefix "IPT SPOOFED packet: " 
-A INPUT ! -s 172.24.50.0/28 -i siemif -j DROP 
-A INPUT -i lo -j ACCEPT 
-A INPUT -s 224.0.0.0/4 -j DROP 
-A INPUT -d 224.0.0.0/4 -j DROP 
-A INPUT -s 240.0.0.0/5 -j DROP 
-A INPUT -d 10.196.129.255/32 -j DROP 
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A INPUT -p icmp -m state --state NEW -m icmp --icmp-type 8 -m limit --limit 1/sec --limit-burst 1 -j ACCEPT 
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j SSH 
-A INPUT -j LOG --log-prefix "IPT INPUT packet died: " 
-A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A FORWARD -s 172.24.50.3/32 -m state --state NEW -j ACCEPT 
-A FORWARD -j LOG --log-prefix "IPT FORWARD packet died: " 
-A OUTPUT -p tcp -j TCPFLAGS 
-A OUTPUT -o lo -j ACCEPT 
-A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT 
-A OUTPUT -j LOG --log-prefix "IPT OUTPUT packet died: " 
-A BADFLAGS -j LOG --log-prefix "IPT TCPFLAGS: " 
-A BADFLAGS -j DROP 
-A SSH -m limit --limit 3/min --limit-burst 1 -j ACCEPT 
-A SSH -j LOG --log-prefix "IPT SSH connection too fast: " 
-A SSH -j DROP 
-A TCPFLAGS -p tcp -m state --state INVALID -j LOG --log-prefix "IPT INVALID: " 
-A TCPFLAGS -p tcp -m state --state INVALID -j DROP 
-A TCPFLAGS -p tcp -m tcp ! --tcp-flags FIN,SYN,RST,ACK SYN -m state --state NEW -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags SYN,ACK SYN,ACK -m state --state NEW -j REJECT --reject-with tcp-reset 
-A TCPFLAGS -p tcp -m tcp --tcp-flags FIN,ACK FIN -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags PSH,ACK PSH -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags ACK,URG URG -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags FIN,RST FIN,RST -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags FIN,SYN FIN,SYN -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j BADFLAGS 
-A TCPFLAGS -p tcp -m tcp --tcp-flags FIN,SYN,RST,PSH,ACK,URG NONE -j BADFLAGS 
COMMIT
# Completed on Mon May 14 07:37:11 2012

  reply	other threads:[~2012-05-14  5:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11 15:04 Problems with a forward rule C. L. Martinez
2012-05-12 15:47 ` Jan Engelhardt
2012-05-12 20:53   ` Tom van Leeuwen
2012-05-14  5:45     ` C. L. Martinez [this message]
2012-05-14  6:33       ` Tom van Leeuwen
2012-05-14  6:40         ` C. L. Martinez
2012-05-14  7:03           ` Tom van Leeuwen
2012-05-14  7:06             ` C. L. Martinez
2012-05-14  7:24               ` Tom van Leeuwen
2012-05-14 16:47                 ` carlopmart
2012-05-14  7:26       ` Neal Murphy
2012-05-14  8:18         ` C. L. Martinez
2012-05-14 17:55           ` Neal Murphy
2012-05-14 19:35             ` carlopmart
2012-05-14 21:12               ` Neal Murphy

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='CAEjQA5LAwmxTwAGWJH5A5Bs57h8=BSXWwiWegYmVKSM7ZtvtmA@mail.gmail.com' \
    --to=carlopmart@gmail.com \
    --cc=netfilter@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.