xref: /netbsd-src/external/bsd/ipf/dist/rules/ftp-proxy (revision bc4097aacfdd9307c19b7947c13c6ad6982527a9)
1*bc4097aaSchristosHow to setup FTP proxying using the built in proxy code.
2*bc4097aaSchristos========================================================
3*bc4097aaSchristos
4*bc4097aaSchristosNOTE: Currently, the built-in FTP proxy is only available for use with NAT
5*bc4097aaSchristos      (i.e. only if you're already using "map" rules with ipnat).  It does
6*bc4097aaSchristos      support null-NAT mappings, that is, using the proxy without changing
7*bc4097aaSchristos      the addresses.
8*bc4097aaSchristos
9*bc4097aaSchristosLets assume your network diagram looks something like this:
10*bc4097aaSchristos
11*bc4097aaSchristos
12*bc4097aaSchristos[host A]
13*bc4097aaSchristos   |a
14*bc4097aaSchristos---+-------------+----------
15*bc4097aaSchristos                 |b
16*bc4097aaSchristos             [host B]
17*bc4097aaSchristos                 |c
18*bc4097aaSchristos---+-------------+----------
19*bc4097aaSchristos   |d
20*bc4097aaSchristos[host C]
21*bc4097aaSchristos
22*bc4097aaSchristosand IP Filter is running on host B.  If you want to proxy FTP from A to C
23*bc4097aaSchristosthen you would do:
24*bc4097aaSchristos
25*bc4097aaSchristosmap int-c ipaddr-a/32 -> ip-addr-c-net/32 proxy port ftp ftp/tcp
26*bc4097aaSchristos
27*bc4097aaSchristosint-c = name of "interface c"
28*bc4097aaSchristosipaddr-a = ip# of interface a
29*bc4097aaSchristosipaddr-c-net = another ip# on the C-network (usually not the same as the
30*bc4097aaSchristosinterface).
31*bc4097aaSchristos
32*bc4097aaSchristose.g., if host A was 10.1.1.1, host B had two network interfaces ed0 and vx0
33*bc4097aaSchristoswhich had IP#'s 10.1.1.2 and 203.45.67.89 respectively, and host C was
34*bc4097aaSchristos203.45.67.90, you would do:
35*bc4097aaSchristos
36*bc4097aaSchristosmap vx0 10.1.1.1/32 -> 203.45.67.91/32 proxy port ftp ftp/tcp
37*bc4097aaSchristos
38*bc4097aaSchristoswhere:
39*bc4097aaSchristosipaddr-a = 10.1.1.1
40*bc4097aaSchristosint-c = vx0
41*bc4097aaSchristosipaddr-c-net = 203.45.67.91
42*bc4097aaSchristos
43*bc4097aaSchristosThe "map" rule for this proxy should precede any other NAT rules you are
44*bc4097aaSchristosusing.
45*bc4097aaSchristos
46