natd and jails for multipel IP addresses

Michael R. Wayne wayne at staff.msen.com
Mon Mar 12 18:20:59 UTC 2007


I'm trying to add a second IP address to an existing jail
using natd and I must be missing something.  

Setup:
   HOST_IP	The host, attached to fxp0
   JAIL_IP	The existing, working jail
   2ND_IP	The IP address I'm trying to natd to the jail

I've got ipfw rules to catch traffic to/from the new IP and nothing
blocking them:
   00300 divert 8668 ip from any to 2ND_IP via fxp0
   00310 divert 8668 ip from 2ND_IP to any via fxp0

natd is running with:
   /sbin/natd -log -verbose -redirect_address JAIL_IP 2ND_IP -alias_address JAIL_IP

But, natd seems to be translating the source, not the dest IP:
   % ping 2ND_IP
yields:
   Out {default}[ICMP] [ICMP] HOST_IP -> 2ND_IP 8(0) aliased to
	      [ICMP] JAIL_IP -> 2ND_IP 8(0)

Whereas, I would expect this to do:
   HOST_IP -> 2ND_IP
translated to
   HOST_IP -> JAIL_IP
and the reverse.

WTH am I missing here?

/\/\ \/\/


More information about the freebsd-questions mailing list