host redirection via ipfw

On our gateway we have FrreBSD with ipfw.
Sometimes we need to redirect all clients requests going to 80 port to out internal server's port 8080. What rule should I add to ipfw to do this?
I'm kinda lost with this fwd and divert commands.
 
Thank you! In my case rule will look like
Code:
ipfw add fwd 192.168.0.1,8080 ip from $my_net to any 80
It's for isp's gateway.
General meaning of this is to pass _any_ request for web page to our dedicated web server from any user whose balance < 0. Web server has mini-faq about paying for Internet.
 
=( No this code doesn't work =(
Requests to 192.168.0.1 arrives as
"all tcp 78.108.88.83:80 <- *.*.*.*:61726"

So there is no change in destination address and port.
How can i make ipfw change dst addr&port?

Or can i do it on webserver FreeBSD box (on which that requests arrives). It has only pf.
 
I don't think you can use fwd in the manner you describe. It's only useful for forwarding packets on the same localnet.

Use NAT. Read natd(8) and see [thread=230]this thread[/thread].
 
Back
Top