DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th May 2008
relch relch is offline
New User
 
Join Date: May 2008
Posts: 1
Thanked 0 Times in 0 Posts
Default fwd..help!

hello, just want to know the use of ipfw <b>fwd</b> keyword. can I use it to forward http request to an apache webserver that resides in my LAN?

pls provide samples for it. thanks!
__________________
experience teaches well, just strike the rock!
Reply With Quote
  #2   (View Single Post)  
Old 19th May 2008
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

The IPFW fwd keyword passes packets destined for one host to another host. The packets are not modified in any way, which means the host the packets are being forwarded to has to know how to handle the unmodified packets.

The most common use of the fwd command is to redirect HTTP packets to a local proxy server, or to redirect SMTP packets to a local mail server:
Code:
# ipfw add fwd 127.0.0.1:3128 tcp from 192.168.0.0/24 to any 80 in recv fxp0
# ipfw add fwd 127.0.0.1:25 tcp from 192.168.0.0/24 to any 25 in recv xl0
The next most common use is probably to redirect traffic through alternate routes/interfaces, usually VPN links.
Code:
# ipfw add fwd 10.7.7.1 ip from 192.168.0.0/24 to 192.168.1.0/24 in recv re0
where 10.7.7.1 is the remote IP of a VPN link, and 192.168.1.0/24 is the private subnet of the remote network.

You probably don't want to use fwd. You want to look into natd(8), which does IP translations and port forwarding. If you are using FreeBSD 7.x, you can also use the new nat keyword with ipfw(8).
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick