I will try to be more specific.
Machine 1:
Running Mac OS X Server 10.1 and have ip 80.62.40.109 (ISP) +
192.168.1.1 (local)
This is done with ip aliases.
Machine 2:
Running Mac IS X Client 10.1 and have ip 192.168.1.2.
It uses 192.168.1.1 as gateway.
This far everything works great
What I want is to have incomming traffic on 192.168.1.1:9000 to be routed to 192.168.1.2:21
Here is my startup script running on machine 1:
---------------------------------------------------------------------------
#!/bin/sh
##
# NAT enables internet connection to be shared.
##
. /etc/rc.common
ConsoleMessage "Starting NAT"
ConsoleMessage "Setting NAT parameters"
ifconfig en0 alias 192.168.1.1 255.255.255.0
natd -dynamic -interface en0
/sbin/ipfw -f flush
/sbin/ipfw add divert natd all from any to any via en0
/sbin/ipfw add pass all from any to any
----------------------------------------------------------------------------
and here is what I get when I type ifconfig -a on machine 1 :
----------------------------------------------------------------------------
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
en0: flags=8863<UP,BROADCAST,b6,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet 80.62.40.109 netmask 0xfffffff0 broadcast 80.62.40.111
inet 192.168.1.1 netmask 0xffffff00 broadcast 255.255.255.0
ether 00:0a:27:7d:41:16
media: autoselect (100baseTX <full-duplex>) status: active
supported media: 10baseT/UTP 10baseT/UTP <full-duplex> 100baseTX 100baseTX <full-duplex> autoselect autoselect 10baseT/UTP
-----------------------------------------------------------------------------