Re: Firewall Redirect

2007-12-01 Thread CyberLeo Kitsana
Lucas Neves Martins wrote:
422  ipfw add 950 divert 8082 tcp from any to any 80 via em0

Hi!

I do something similar, except with a small home-grown server used to
serve 'You are banned' pages to people who insist on driving my poor
little webserver into swap.

The directive you're looking for is 'fwd'.

ipfw add 44001 fwd 127.0.0.44 tcp from ${luser} to any 80 in recv fxp0

-- 
Fuzzy love,
-CyberLeo
Technical Administrator
CyberLeo.Net Webhosting
http://www.CyberLeo.Net
[EMAIL PROTECTED]

Furry Peace! - http://.fur.com/peace/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Firewall Redirect

2007-11-30 Thread pete wright
On Nov 30, 2007 5:59 AM, Lucas Neves Martins [EMAIL PROTECTED] wrote:
 Hello guys,

 I´m having the following problem:

 Redirect requests from the port 80, to the port 8082. - for apache tomcat.

 I´m new on freeBSD, Of course, I had looked out on google, and read the
 firewall section on the Handbook.

snipping some ipfw rules...


 PS: I´m trying to do this, to make the user tomcat run the apache-tomcat,
 opening the port 8082, and make it

 transparent to users who access the domain by the common port 80.


another method to achieve this that may be interesting for you is to
use mod_jk to redirect requests coming in on your priv'd port 80
apache daemon to your tomcat processes on an unpriv'd port:

http://tomcat.apache.org/connectors-doc/

I won't go into the whole configuration here - but going this route
may give you more flexibility than using a packetfilter ruleset and
will allow you take advantage of load balancing etc. with mod_jk as
well.  i currently use this setup for a site that serves both static
content from httpd and .jsp pages from tomcat all on the same box.

HTH
-pete

-- 
~~o0OO0o~~
Pete Wright
www.nycbug.org
NYC's *BSD User Group
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Firewall Redirect

2007-11-30 Thread usleepless
On 11/30/07, Lucas Neves Martins [EMAIL PROTECTED] wrote:
 Hello guys,

 I´m having the following problem:

 Redirect requests from the port 80, to the port 8082. - for apache tomcat.

 I´m new on freeBSD, Of course, I had looked out on google, and read the
 firewall section on the Handbook.

 But only found missed things, and nothing worked.

 I have tried this commands:

 #history | grep divert

 H



422  ipfw add 950 divert 8082 tcp from any to any 80 via em0
425  ipfw add 950 divert 8082 tcp from any to any 80 via em0
428  ipfw add 950 divert 80 tcp from any to any 8082 via em0
432  ipfw add 950 divert 8082 tcp from any to any 80 via em0
435  ipfw add 950 divert 8082 tcp from any to any 80 via em0



 I know how works the number 950, I know it is on the right position, but I
 dont know how works the divert,

 and even what it is. I dont know if divert 8082 makes the requests come
 from 80, or go to 80.

 damn...

 Any help will be useful.

AFAIK, divert in ipfw diverts to unix-domain sockets.

i think you might pull it off with ipnat +

/etc/ipnat.conf:
 rdr em0 0.0.0.0/0 port 80 - 0.0.0.0/0 port 8082

regards,

usleep
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Firewall Redirect

2007-11-30 Thread Lucas Neves Martins
Hello guys,

I´m having the following problem:

Redirect requests from the port 80, to the port 8082. - for apache tomcat.

I´m new on freeBSD, Of course, I had looked out on google, and read the
firewall section on the Handbook.

But only found missed things, and nothing worked.

I have tried this commands:

#history | grep divert

H



   422  ipfw add 950 divert 8082 tcp from any to any 80 via em0
   425  ipfw add 950 divert 8082 tcp from any to any 80 via em0
   428  ipfw add 950 divert 80 tcp from any to any 8082 via em0
   432  ipfw add 950 divert 8082 tcp from any to any 80 via em0
   435  ipfw add 950 divert 8082 tcp from any to any 80 via em0



I know how works the number 950, I know it is on the right position, but I
dont know how works the divert,

and even what it is. I dont know if divert 8082 makes the requests come
from 80, or go to 80.

damn...

Any help will be useful.

--

PS: I´m trying to do this, to make the user tomcat run the apache-tomcat,
opening the port 8082, and make it

transparent to users who access the domain by the common port 80.


Thanks.


-- 
Snowniak - BR
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]

Re: Firewall Redirect

2007-11-30 Thread Rob

Lucas Neves Martins wrote:

Redirect requests from the port 80, to the port 8082. - for apache tomcat.
[[snip]]
   422  ipfw add 950 divert 8082 tcp from any to any 80 via em0
   425  ipfw add 950 divert 8082 tcp from any to any 80 via em0
   428  ipfw add 950 divert 80 tcp from any to any 8082 via em0


It's not as clean as doing it with ipfw, but there a port redirect utilty in 
ports/net/redir that might do might accomplish what you want.

 -RW

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]