Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2001 13:43:00 -0800
From:      "Crist J. Clark" <cjclark@reflexnet.net>
To:        doc@freebsd.org
Subject:   Possible FAQ Entry: ipfw(8) fwd Rules
Message-ID:  <20010128134300.X10761@rfx-216-196-73-168.users.reflex>

next in thread | raw e-mail | index | archive | help
Another question I am sick of answering on the lists. People try to
use an ipfw(8) fwd rule inappropriately when they should be using
NAT. An entry on this in the FAQ would fit right in with 9.20. I made
a flat text, first pass at such an entry. Please double check that I
am a recipient of any mails, I am not currently subscribed to -doc.
Thanks.


9.20.1. Why is my ipfw(8) 'fwd' rule to redirect a service to
another machine not working?

Because you probably want to do network address translation (NAT) and
not just forward packets. A 'fwd' rule does exactly what it says, it
forwards packets. It does not actually change the data inside the
packet. Say we have a rule like,

  01000 fwd 10.0.0.1 from any to foo 21

When a packet with a destination address of 'foo' arrives at the machine
with this rule, the packet is forwarded to 10.0.0.1, but the packet
still has the destination address of 'foo.' The destination address of
the packet is <em>not</em> changed to 10.0.0.1. Most machines would
probably drop a packet that they receive with a destination address
that is not their own. Therefore, using a 'fwd' rule does not often
work the way the naive user expects. This behavior is a feature and
not a bug.

See the answer to 9.20, natd(8), or one of the several port redirecting
utilities in the ports collection for a correct way to do this.

-- 
Crist J. Clark                           cjclark@alum.mit.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010128134300.X10761>