Linux Netfilter discussions
 help / color / mirror / Atom feed
From: varun <varun_saa@rediffmail.com>
To: Rob Sterenborg <rob@sterenborg.info>
Cc: netfilter@lists.netfilter.org
Subject: RE: not able to ssh from the firewall
Date: Fri, 08 Sep 2006 07:52:16 +0530	[thread overview]
Message-ID: <1157682136.4889.4.camel@nirvana.aurokruti.in> (raw)
In-Reply-To: <001701c6d2c0$4d588b00$0101000a@tanjian>

On Thu, 2006-09-07 at 22:57 +0200, Rob Sterenborg wrote:
> >>> I am not able to ssh from the firewall
> >>> to a client. Though the reverse is
> >>> working.
> >>> 
> >>> I would also like to put :
> >>> 
> >>> -A OUTPUT -j DROP
> >>> 
> >>> But if I do that clients are not able to connect
> >>> to the net. I need add a rule which I could
> >>> not figure out.
> >> 
> >> You should allow SSH out when you want to be able to use it.
> >> SSH listens on port 22, so this should do it:
> >> 
> >> -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> >> -A OUTPUT -p tcp --dport 22 -j ACCEPT
> >> -A OUTPUT -j DROP
> > 
> > No that did not work.
> 
> Of course not. AFAIK your current OUTPUT policy is still ACCEPT (see
> below) so that should not be the problem. (Don't mess with the OUTPUT
> chain untill your INPUT chain is working as you want it to.)
> 
> >>> :INPUT ACCEPT [80:13056]
> >>> -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
> >> 
> >> It looks like eth0 is connected to the internet and eth1 to your LAN.
> >> Check if outgoing ssh works using:
> >> 
> >> -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> 
> Did you try this?
> If it doesn't work, put a LOG rule just before the DROP rule to see what
> get's dropped when you're trying to setup an ssh session.
> 
> >>> :OUTPUT ACCEPT [80:13056]
> >>> -A OUTPUT -j ACCEPT
> >>> -A OUTPUT -o lo -j ACCEPT

OK, I had set :

-A OUTPUT -j DROP

So nothing worked.

If OUTPUT is set to :

-A OUTPUT -j ACCEPT

Then everthing works. I can ssh, ping to clients .

So how do I get it working with OUTPUT as DROP ?



> 
> Here is where I see you're not dropping anything in the OUTPUT chain.
> The first rule accepts everything so the second will never match and is
> useless. Further, your chain polocy is ACCEPT, so if you're not going to
> drop anything: why have rules in that chain to accept packets that would
> be accepted anyway? Just get rid of the OUTPUT rules for now and leave
> it's policy ACCEPT.
> 
> 
> Gr,
> Rob
> 
> 
> 



  reply	other threads:[~2006-09-08  2:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06  2:14 not able to ssh from the firewall varun
2006-09-06  5:31 ` Rob Sterenborg
2006-09-07 14:01   ` varun
2006-09-07 20:57     ` Rob Sterenborg
2006-09-08  2:22       ` varun [this message]
2006-09-08  5:29         ` Rob Sterenborg
2006-09-19 13:38           ` varun
2006-09-12 19:48         ` connrate and Linux 2.6.14 and 2.6.16 Pablo Sanchez
     [not found]       ` <1157854906.4748.4.camel@nirvana.aurokruti.in>
2006-09-11  8:29         ` not able to ssh from the firewall Rob Sterenborg

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=1157682136.4889.4.camel@nirvana.aurokruti.in \
    --to=varun_saa@rediffmail.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=rob@sterenborg.info \
    /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