Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Martijn Lievaart <m@rtij.nl>
To: Maxim Veksler <hq4ever@gmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: can't ssh outside with OUTPUT (policy ACCEPT)
Date: Wed, 08 Aug 2007 19:45:33 +0200	[thread overview]
Message-ID: <46BA013D.6020709@rtij.nl> (raw)
In-Reply-To: <b400c69a0708080942j69063e1em16ef7224f78f6fea@mail.gmail.com>

Maxim Veksler wrote:
> Hello,
>
> Follwing a recent theread on this list, I've configued my firewall to
> allow incoming traffic from specific IP's only. Now I can't ssh
> outside, could some please explain why this happening ?
>
> The system is redhat 4.
>
> [root@prd-001 ~]# iptables -L
> Chain INPUT (policy DROP)
> target     prot opt source               destination
> ACCEPT     all  --  xxx.114.183.1        anywhere
> ACCEPT     all  --  yyy.8.145.182        anywhere
> ACCEPT     all  --  zzz.68.137.158       anywhere
> ACCEPT     all  --  anywhere             anywhere
>
> Chain FORWARD (policy ACCEPT)
> target     prot opt source               destination
>
> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination
>
> [root@prd-001 ~]# iptables-save
> # Generated by iptables-save v1.2.11 on Wed Aug  8 19:26:51 2007
> *filter
> :INPUT DROP [110564:24802104]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [637061:352312072]
> -A INPUT -s xxx.114.183.1 -j ACCEPT
> -A INPUT -s yyy.8.145.182 -j ACCEPT
> -A INPUT -s zzz.68.137.158 -j ACCEPT
> -A INPUT -i lo -j ACCEPT
> COMMIT
> # Completed on Wed Aug  8 19:26:51 2007
>
>
> Trying to ssh to "aaa.bbb.216.35" fails with timeout, looking at
> tcpdump on the otherside shows no TCP handshack is made.
>   

You don't allow the return packets in. Add a -m state --state 
ESTABLISHED,RELATED match as the first rule in your INPUT chain.

HTH,
M4



  reply	other threads:[~2007-08-08 17:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 16:42 can't ssh outside with OUTPUT (policy ACCEPT) Maxim Veksler
2007-08-08 17:45 ` Martijn Lievaart [this message]
2007-08-08 19:35   ` Maxim Veksler
2007-08-08 21:46     ` Martijn Lievaart
2007-08-08 22:46       ` Maxim Veksler
2007-08-09  5:16         ` Martijn Lievaart

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=46BA013D.6020709@rtij.nl \
    --to=m@rtij.nl \
    --cc=hq4ever@gmail.com \
    --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