On Wed, Sep 01, 2004 at 03:28:30PM +1000, Peter Jeremy wrote:
> I am trying to migrate an existing firewall to IPFilter 3.4.33 on a
> Solaris 8 host and am having a problem replicating some of the
> existing functionality.  In particular, I have a situation where a
> single internal host needs to have two external (NAT'd) addresses,
> depending on the address of the external peer: A "default" address and
> a "special" address that is used by a subset of clients.  The internal
> host needs to be NAT'd to the "default" address for both incoming and
> outgoing connections, except for a specific external subnet.  Whilst I
> can use policy RDR rules to handle normal TCP, I can't work out how to
> get FTP through.
> 
> Taking the following diagram:
> HostC is the FTP server and has a physical address of 192.168.164.14.
> HostA (and anything else in 10.10.10.0/24) connects to the FTP server
> using the "special" address 172.16.91.195.
> HostB (and anything else not in 10.10.10.0/24) connects to the FTP server
> using the "default" address 172.16.91.14.
> 
> +-------+                    +-------+
> |       |10.10.10.18         |       |
> | HostA |--------------------|       |
> |       |       172.16.91.195|       |                    +-------+
> +-------+                    |       |                    |       |
>                              |  NAT  |--------------------| HostC |
> +-------+                    |       |      192.168.164.14|       |
> |       |172.16.9.12         |       |                    +-------+
> | HostB |--------------------|       |
> |       |        172.16.91.14|       |
> +-------+                    +-------+
> 
> My best guess of the relevant ipnat rules is:
> 
> map ce91000 192.168.164.14/32 -> 176.16.91.14/32 proxy port ftp ftp/tcp
> rdr ce91000 from 10.10.10.0/24 to 176.16.91.195/32 port = 22 -> 192.168.164.14 port 
> 22 tcp
> rdr ce91000 from 10.10.10.0/24 to 176.16.91.195/32 port = 21 -> 192.168.164.14 port 
> 21 tcp
> bimap ce91000 192.168.164.14/32 -> 176.16.91.14/32

I dont understand your map and rdr rules.

I'd say:

# For the FTP traffic between A/B to C:
map ce91000 from 10.10.10.0/24 to 192.168.164.14/32 -> 172.16.91.195/32 proxy port ftp 
ftp/tcp
map ce91000 from any to 192.168.164.14/32 -> 172.16.91.14/32 proxy port ftp ftp/tcp
# For other traffic between A/B and C
map ce91000 from 10.10.10.0/24 to 192.168.164.14/32 -> 172.16.91.195/32  portmap 
tcp/udp 1025:65000
map ce91000 from 10.10.10.0/24 to 192.168.164.14/32 -> 172.16.91.195/32
map ce91000 from any to 192.168.164.14/32 -> 172.16.91.195/32  portmap tcp/udp 
1025:65000
map ce91000 from any to 192.168.164.14/32 -> 172.16.91.195/32

# For traffic the other way around:
# You have to amke up your mind where incoming connections to 172.16.91.195
# and 172.16.91.14 go to. E.g.:
rdr ce91000 from 192.168.164.14 to 172.16.91.195 port = 22 -> 10.10.10.111 port 22 tcp
rdr ce91000 from 192.168.164.14 to 172.16.91.14 port = 22 -> 172.16.9.12 port 22 tcp

I'd remove the bimap.

-Guido

Reply via email to