Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So i have a single BSD firewall using NATD and IPFW. This firewall has 5 static IP's assigned to it.

Using NATD i can easily forward and entire external ip to an internal ip. But when the internal server sends it's response how do i get it to come out of the correct IP? NATD just uses the firewalls default gateway.

NATD will only listen on one interface, so it cannot work both directions. It will only forward traffic from external IP's to internal IP's. I need to ensure that all outgoing traffic from a specific internal IP address goes of a specific external IP address.

share|improve this question
What makes you think NATD isn't rewriting the outbound traffic? – Jenny D Dec 3 '13 at 9:02
it does rewrite outbound traffic, but it rewrite all outbound traffic to the same IP. I need to be able to specify a set of internal IP's to be rewritten to a specific external IP. – TriadicTech Dec 3 '13 at 10:12
If it's NATing everything to one outbound IP it's because you've configured it to do so. It's quite configurable. You may want to look at the option -redirect_address in the MAN page, which describes using static NAT. – Jenny D Dec 3 '13 at 10:47
up vote 0 down vote accepted

As suggested in the comments, i've found that "redirect_address" works both ways.

redirect_address private-ip public-ip
redirect_address public-ip private-ip

the above configuration forward the public ip's traffic to your servers private ip, and also forwards it's response and other outgoing traffic to the public ip.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.