# Change source IP for specific target IPs (from jail)



## icecoke (Aug 15, 2014)

Hi,

I have no clue where to start with ipfw, I just have these (following) needs from my colleagues. I would be really pleased, if some can give me some samples how to do this:

We have set an ipsec connection with strongswan (on the host), which is working fine - even from a jail, which has the appropriate alias posted. What we need is a translation of the source IP, each time one is accessing an IP in the range of the ipsec target. In iptables it would be something like this: 
	
	



```
iptables -t nat -A POSTROUTING -o eth0 -d 4.3.2.1 -j SNAT --to 1.2.3.4
```

Could someone 'translate' this into ipfw, if this would be the right way to achieve this?

Many thanks in advance!
Jimmy


----------



## asteriskRoss (Aug 24, 2014)

I use PF and am no IPFW expert.  However, since you haven't received any replies in over a week I will point you in the direction of natd(8).  Also have a look at the IPFW address redirection section in the handbook, though the examples would be for more typical NAT use and not, if I understand correctly, an exact match for what you are trying to do.


----------

