All of lore.kernel.org
 help / color / mirror / Atom feed
* opening connection for Tomcat
@ 2004-04-08 15:13 Gianni Pucciani
  2004-04-08 16:01 ` ro0ot
  2004-04-08 16:30 ` Alexis
  0 siblings, 2 replies; 15+ messages in thread
From: Gianni Pucciani @ 2004-04-08 15:13 UTC (permalink / raw)
  To: netfilter

Hi all,
I was in trouble opening a port for services with tomcat:
Is this rule right? I'm behind an adsl router that forward every 
connection on port 8080 to <myprivateip>.

iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m 
state --state NEW -j ACCEPT




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 15:13 opening connection for Tomcat Gianni Pucciani
@ 2004-04-08 16:01 ` ro0ot
  2004-04-08 16:30 ` Alexis
  1 sibling, 0 replies; 15+ messages in thread
From: ro0ot @ 2004-04-08 16:01 UTC (permalink / raw)
  To: Gianni Pucciani; +Cc: netfilter

You should only have this below: -

iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -m state --state 
NEW -j ACCEPT

or

iptables -A INPUT -p tcp -s 0.0.0.0/0 --sport 1024: -d <myprivateip> 
--dport 8080 -m state --state NEW -j ACCEPT

Regards,
ro0ot

Gianni Pucciani wrote:

> Hi all,
> I was in trouble opening a port for services with tomcat:
> Is this rule right? I'm behind an adsl router that forward every 
> connection on port 8080 to <myprivateip>.
>
> iptables -P INPUT DROP
> iptables -P OUTPUT ACCEPT
> iptables -P FORWARD DROP
>
> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m 
> state --state NEW -j ACCEPT
>
>
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 15:13 opening connection for Tomcat Gianni Pucciani
  2004-04-08 16:01 ` ro0ot
@ 2004-04-08 16:30 ` Alexis
  2004-04-08 17:50   ` Rob Sterenborg
  2004-04-08 17:55   ` Gianni Pucciani
  1 sibling, 2 replies; 15+ messages in thread
From: Alexis @ 2004-04-08 16:30 UTC (permalink / raw)
  To: Gianni Pucciani; +Cc: netfilter

you must change to OUTPUT the first rule at least. you're filtering all
outgoing packets.


----- Original Message ----- 
From: "Gianni Pucciani" <gp.puccio@tin.it>
To: <netfilter@lists.netfilter.org>
Sent: Thursday, April 08, 2004 12:13 PM
Subject: opening connection for Tomcat


> Hi all,
> I was in trouble opening a port for services with tomcat:
> Is this rule right? I'm behind an adsl router that forward every
> connection on port 8080 to <myprivateip>.
>
> iptables -P INPUT DROP
> iptables -P OUTPUT ACCEPT
> iptables -P FORWARD DROP
>
> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
> state --state NEW -j ACCEPT
>
>
>
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 16:30 ` Alexis
@ 2004-04-08 17:50   ` Rob Sterenborg
  2004-04-08 18:08     ` Alexis
  2004-04-08 20:13     ` Gianni Pucciani
  2004-04-08 17:55   ` Gianni Pucciani
  1 sibling, 2 replies; 15+ messages in thread
From: Rob Sterenborg @ 2004-04-08 17:50 UTC (permalink / raw)
  To: Netfilter

On Thu, 2004-04-08 at 18:30, Alexis wrote:
> you must change to OUTPUT the first rule at least. you're filtering all
> outgoing packets.
> 

In these rules I only see policy ACCEPT for the OUTPUT chain, so IMHO
there's no filtering there.

> > Hi all,
> > I was in trouble opening a port for services with tomcat:
> > Is this rule right? I'm behind an adsl router that forward every
> > connection on port 8080 to <myprivateip>.
> >
> > iptables -P INPUT DROP
> > iptables -P OUTPUT ACCEPT
> > iptables -P FORWARD DROP
> >
> > iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> > iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
> > state --state NEW -j ACCEPT

Is your Tomcat listening on 8080/tcp ? (netstat -an|grep 8080)
Are you sure that your router is forwarding all connections ?

Check with a logging rule between the -m state and the -p tcp rules to
see what's going on (if there is) :

iptables -A INPUT -j LOG --log-prefix "_ipt:check"


Gr,
Rob




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 16:30 ` Alexis
  2004-04-08 17:50   ` Rob Sterenborg
@ 2004-04-08 17:55   ` Gianni Pucciani
  1 sibling, 0 replies; 15+ messages in thread
From: Gianni Pucciani @ 2004-04-08 17:55 UTC (permalink / raw)
  To: Alexis, netfilter


Alexis wrote:

>you must change to OUTPUT the first rule at least. you're filtering all
>outgoing packets.
>  
>
? The output chain has the ACCEPT policy, no packets are filtered, isn't it?

Gianni

>
>----- Original Message ----- 
>From: "Gianni Pucciani" <gp.puccio@tin.it>
>To: <netfilter@lists.netfilter.org>
>Sent: Thursday, April 08, 2004 12:13 PM
>Subject: opening connection for Tomcat
>
>
>  
>
>>Hi all,
>>I was in trouble opening a port for services with tomcat:
>>Is this rule right? I'm behind an adsl router that forward every
>>connection on port 8080 to <myprivateip>.
>>
>>iptables -P INPUT DROP
>>iptables -P OUTPUT ACCEPT
>>iptables -P FORWARD DROP
>>
>>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
>>iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
>>state --state NEW -j ACCEPT
>>
>>
>>
>>
>>    
>>
>
>
>
>  
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 17:50   ` Rob Sterenborg
@ 2004-04-08 18:08     ` Alexis
  2004-04-08 20:13     ` Gianni Pucciani
  1 sibling, 0 replies; 15+ messages in thread
From: Alexis @ 2004-04-08 18:08 UTC (permalink / raw)
  To: netfilter

sorry, its true, my mistake


----- Original Message ----- 
From: "Rob Sterenborg" <rob@sterenborg.info>
To: "Netfilter" <netfilter@lists.netfilter.org>
Sent: Thursday, April 08, 2004 2:50 PM
Subject: Re: opening connection for Tomcat


> On Thu, 2004-04-08 at 18:30, Alexis wrote:
> > you must change to OUTPUT the first rule at least. you're filtering all
> > outgoing packets.
> > 
> 
> In these rules I only see policy ACCEPT for the OUTPUT chain, so IMHO
> there's no filtering there.
> 
> > > Hi all,
> > > I was in trouble opening a port for services with tomcat:
> > > Is this rule right? I'm behind an adsl router that forward every
> > > connection on port 8080 to <myprivateip>.
> > >
> > > iptables -P INPUT DROP
> > > iptables -P OUTPUT ACCEPT
> > > iptables -P FORWARD DROP
> > >
> > > iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> > > iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
> > > state --state NEW -j ACCEPT
> 
> Is your Tomcat listening on 8080/tcp ? (netstat -an|grep 8080)
> Are you sure that your router is forwarding all connections ?
> 
> Check with a logging rule between the -m state and the -p tcp rules to
> see what's going on (if there is) :
> 
> iptables -A INPUT -j LOG --log-prefix "_ipt:check"
> 
> 
> Gr,
> Rob
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 17:50   ` Rob Sterenborg
  2004-04-08 18:08     ` Alexis
@ 2004-04-08 20:13     ` Gianni Pucciani
  2004-04-08 21:53       ` Antony Stone
  2004-04-09  1:05       ` Alexis
  1 sibling, 2 replies; 15+ messages in thread
From: Gianni Pucciani @ 2004-04-08 20:13 UTC (permalink / raw)
  To: Rob Sterenborg; +Cc: Netfilter

Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no good.

Many thanks

Gianni
Rob Sterenborg wrote:

>On Thu, 2004-04-08 at 18:30, Alexis wrote:
>  
>
>>you must change to OUTPUT the first rule at least. you're filtering all
>>outgoing packets.
>>
>>    
>>
>
>In these rules I only see policy ACCEPT for the OUTPUT chain, so IMHO
>there's no filtering there.
>
>  
>
>>>Hi all,
>>>I was in trouble opening a port for services with tomcat:
>>>Is this rule right? I'm behind an adsl router that forward every
>>>connection on port 8080 to <myprivateip>.
>>>
>>>iptables -P INPUT DROP
>>>iptables -P OUTPUT ACCEPT
>>>iptables -P FORWARD DROP
>>>
>>>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
>>>iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
>>>state --state NEW -j ACCEPT
>>>      
>>>
>
>Is your Tomcat listening on 8080/tcp ? (netstat -an|grep 8080)
>Are you sure that your router is forwarding all connections ?
>
>Check with a logging rule between the -m state and the -p tcp rules to
>see what's going on (if there is) :
>
>iptables -A INPUT -j LOG --log-prefix "_ipt:check"
>
>
>Gr,
>Rob
>
>
>
>
>  
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 20:13     ` Gianni Pucciani
@ 2004-04-08 21:53       ` Antony Stone
  2004-04-08 23:18         ` Frank Gruellich
  2004-04-09  6:28         ` Gianni Pucciani
  2004-04-09  1:05       ` Alexis
  1 sibling, 2 replies; 15+ messages in thread
From: Antony Stone @ 2004-04-08 21:53 UTC (permalink / raw)
  To: Netfilter

On Thursday 08 April 2004 9:13 pm, Gianni Pucciani wrote:

> Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no good.

You are certainly very unlikely to receive packets from that address, as it 
does not exist.

Regards,

Antony.

-- 
Success is a lousy teacher.  It seduces smart people into thinking they can't 
lose.

 - William H Gates III

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



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 21:53       ` Antony Stone
@ 2004-04-08 23:18         ` Frank Gruellich
  2004-04-09  6:28         ` Gianni Pucciani
  1 sibling, 0 replies; 15+ messages in thread
From: Frank Gruellich @ 2004-04-08 23:18 UTC (permalink / raw)
  To: Netfilter

* Antony Stone <Antony@Soft-Solutions.co.uk>  8. Apr 04:
> On Thursday 08 April 2004 9:13 pm, Gianni Pucciani wrote:
> > Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no good.

I think you meant something like "0.0.0.0/0.0.0.0" or its alias
"0.0.0.0/0" or its alias "0/0" or its alias "".  So, omit it.

> You are certainly very unlikely to receive packets from that address, as it 
> does not exist.

hydra:~# zgrep 'SRC=0\.0\.0\.0' /var/log/kern.log.1.gz |wc -l
     28

Dhcp-clients use it when discovering.  But not to port 8080.

 Regards, Frank.
-- 
Sigmentation fault


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 20:13     ` Gianni Pucciani
  2004-04-08 21:53       ` Antony Stone
@ 2004-04-09  1:05       ` Alexis
  1 sibling, 0 replies; 15+ messages in thread
From: Alexis @ 2004-04-09  1:05 UTC (permalink / raw)
  To: Gianni Pucciani; +Cc: netfilter

oh, i thought you mean all addresses with 0.0.0.0 (as an example) and not
you was setting the rule with explicilt 0.0.0.0

doing this, you are saying 0.0.0.0/32 , this means only this IP address. For
match all ip addresses, leave the modif (-d) without set or use 0.0.0.0/0


regards

----- Original Message ----- 
From: "Gianni Pucciani" <gp.puccio@tin.it>
To: "Rob Sterenborg" <rob@sterenborg.info>
Cc: "Netfilter" <netfilter@lists.netfilter.org>
Sent: Thursday, April 08, 2004 5:13 PM
Subject: Re: opening connection for Tomcat


> Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no good.
>
> Many thanks
>
> Gianni
> Rob Sterenborg wrote:
>
> >On Thu, 2004-04-08 at 18:30, Alexis wrote:
> >
> >
> >>you must change to OUTPUT the first rule at least. you're filtering all
> >>outgoing packets.
> >>
> >>
> >>
> >
> >In these rules I only see policy ACCEPT for the OUTPUT chain, so IMHO
> >there's no filtering there.
> >
> >
> >
> >>>Hi all,
> >>>I was in trouble opening a port for services with tomcat:
> >>>Is this rule right? I'm behind an adsl router that forward every
> >>>connection on port 8080 to <myprivateip>.
> >>>
> >>>iptables -P INPUT DROP
> >>>iptables -P OUTPUT ACCEPT
> >>>iptables -P FORWARD DROP
> >>>
> >>>iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> >>>iptables -A INPUT -p tcp -d <myprivateip> --dport 8080 -s 0.0.0.0 -m
> >>>state --state NEW -j ACCEPT
> >>>
> >>>
> >
> >Is your Tomcat listening on 8080/tcp ? (netstat -an|grep 8080)
> >Are you sure that your router is forwarding all connections ?
> >
> >Check with a logging rule between the -m state and the -p tcp rules to
> >see what's going on (if there is) :
> >
> >iptables -A INPUT -j LOG --log-prefix "_ipt:check"
> >
> >
> >Gr,
> >Rob
> >
> >
> >
> >
> >
> >
>
>
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-08 21:53       ` Antony Stone
  2004-04-08 23:18         ` Frank Gruellich
@ 2004-04-09  6:28         ` Gianni Pucciani
  2004-04-09  6:56           ` giorgio.zarrelli
                             ` (2 more replies)
  1 sibling, 3 replies; 15+ messages in thread
From: Gianni Pucciani @ 2004-04-09  6:28 UTC (permalink / raw)
  To: Netfilter

Antony Stone wrote:
> On Thursday 08 April 2004 9:13 pm, Gianni Pucciani wrote:
> 
> 
>>Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no good.
> 
> 
> You are certainly very unlikely to receive packets from that address, as it 
> does not exist.

Well, I'm not a firewall guru, but I think that 0.0.0.0 address is often 
used to indicate "every address", isn't it?

Gianni
> 
> Regards,
> 
> Antony.
> 




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-09  6:28         ` Gianni Pucciani
@ 2004-04-09  6:56           ` giorgio.zarrelli
  2004-04-09 22:59             ` Antony Stone
  2004-04-09  7:23           ` Rob Sterenborg
  2004-04-09 13:50           ` Alexis
  2 siblings, 1 reply; 15+ messages in thread
From: giorgio.zarrelli @ 2004-04-09  6:56 UTC (permalink / raw)
  To: Gianni Pucciani; +Cc: Netfilter

Hi,

> Well, I'm not a firewall guru, but I think that 0.0.0.0 address is often
> used to indicate "every address", isn't it?

Yes, it is.

E' una convenzione utilizzata.

Ciao

Giorgio Zarrelli


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-09  6:28         ` Gianni Pucciani
  2004-04-09  6:56           ` giorgio.zarrelli
@ 2004-04-09  7:23           ` Rob Sterenborg
  2004-04-09 13:50           ` Alexis
  2 siblings, 0 replies; 15+ messages in thread
From: Rob Sterenborg @ 2004-04-09  7:23 UTC (permalink / raw)
  To: Netfilter

> >>Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no
good.
> >
> >
> > You are certainly very unlikely to receive packets from that address, as
it
> > does not exist.
>
> Well, I'm not a firewall guru, but I think that 0.0.0.0 address is often
> used to indicate "every address", isn't it?

Neither am I ;o). I overlooked that one too.

0.0.0.0 = 0.0.0.0/32. 0.0.0.0 as a host does not exist.
What you meant is 0.0.0.0/0, which is the same as not specifying it.


Gr,
Rob



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-09  6:28         ` Gianni Pucciani
  2004-04-09  6:56           ` giorgio.zarrelli
  2004-04-09  7:23           ` Rob Sterenborg
@ 2004-04-09 13:50           ` Alexis
  2 siblings, 0 replies; 15+ messages in thread
From: Alexis @ 2004-04-09 13:50 UTC (permalink / raw)
  To: Gianni Pucciani; +Cc: netfilter

using the correct mask it is.


----- Original Message ----- 
From: "Gianni Pucciani" <gp.puccio@tin.it>
To: "Netfilter" <netfilter@lists.netfilter.org>
Sent: Friday, April 09, 2004 3:28 AM
Subject: Re: opening connection for Tomcat


> Antony Stone wrote:
> > On Thursday 08 April 2004 9:13 pm, Gianni Pucciani wrote:
> >
> >
> >>Ok, I've fixed the problem: it seems that the address 0.0.0.0 is no
good.
> >
> >
> > You are certainly very unlikely to receive packets from that address, as
it
> > does not exist.
>
> Well, I'm not a firewall guru, but I think that 0.0.0.0 address is often
> used to indicate "every address", isn't it?
>
> Gianni
> >
> > Regards,
> >
> > Antony.
> >
>
>
>
>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: opening connection for Tomcat
  2004-04-09  6:56           ` giorgio.zarrelli
@ 2004-04-09 22:59             ` Antony Stone
  0 siblings, 0 replies; 15+ messages in thread
From: Antony Stone @ 2004-04-09 22:59 UTC (permalink / raw)
  To: Netfilter

On Friday 09 April 2004 7:56 am, giorgio.zarrelli@mammaitalia.com wrote:

> Hi,
>
> > Well, I'm not a firewall guru, but I think that 0.0.0.0 address is often
> > used to indicate "every address", isn't it?
>
> Yes, it is.

"0.0.0.0" is very different from "0.0.0.0/0".

The first means "one specific IP address, which you will never find on a real 
device".

The second means "any IP address at all".

The reason is simply because if you do not specify a netmask, /32 is assumed, 
which means all bits must match exactly.   On the other hand /0 means that no 
bits have to match at all (which is why 0.0.0.0/0 corresponds to all 
addresses).

Regards,

Antony.

-- 
If you can't find an Open Source solution for it, then it isn't a real 
problem.

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



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2004-04-09 22:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-08 15:13 opening connection for Tomcat Gianni Pucciani
2004-04-08 16:01 ` ro0ot
2004-04-08 16:30 ` Alexis
2004-04-08 17:50   ` Rob Sterenborg
2004-04-08 18:08     ` Alexis
2004-04-08 20:13     ` Gianni Pucciani
2004-04-08 21:53       ` Antony Stone
2004-04-08 23:18         ` Frank Gruellich
2004-04-09  6:28         ` Gianni Pucciani
2004-04-09  6:56           ` giorgio.zarrelli
2004-04-09 22:59             ` Antony Stone
2004-04-09  7:23           ` Rob Sterenborg
2004-04-09 13:50           ` Alexis
2004-04-09  1:05       ` Alexis
2004-04-08 17:55   ` Gianni Pucciani

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.