Firewall Redirect

usleepless at gmail.com usleepless at gmail.com
Fri Nov 30 06:59:40 PST 2007


On 11/30/07, Lucas Neves Martins <snowniak at gmail.com> 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


More information about the freebsd-questions mailing list