Why is my ipfw ``fwd'' rule to redirect a service to another machine not working?

Possibly because you 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 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, but it still has the destination address of foo! The destination address of the packet is not changed to 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 user expects. This behavior is a feature and not a bug.

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

Suggest a Site