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

This works correctly for connections between HostB and HostC (FTP and
arbitrary TCP) as well as SSH and FTP control connections between
HostA and HostC but FTP data connections don't work:
- In active mode, the data connection is NAT'd to a source address of
  172.16.91.14 whereas the client needs 172.16.91.195.
- In passive mode, the "227" response to the PASV command is not NAT'd
  so the client is given an address of 192.168.164.14.
- IPFilter 3.x doesn't support enhanced passive mode.

At this stage, migration to IPFilter 4.x is not an option because 4.x
does not support the VLAN interface names on Solaris 8.

I've looked through the IPFilter HOWTO at obfuscation.org as well as
the FAQ at phildev.net without success.  Does anyone have any suggestions?

--
Peter Jeremy

Reply via email to