In some email I received from Lupe Christoph, sie wrote:
[...]
> (ipnat -l)
> map fxp0 from 192.168.0.0/18 to any port = 5376 -> 1.2.3.4/32
> proxy port ftp ftp/tcp
>
> This is from this statement in ipnat.conf:
> map fxp0 from 192.168.0.0/18 to 0.0.0.0/0 port = 21 -> 1.2.3.4/32
> proxy port 21 ftp/tcp
Oops! This is an IPFilter bug that affects little endian machines.
See patch below.
> BTW, there is no text for the proxy clause in the "man 5 ipnat" on
> FreeBSD. Is this am omission in FreeBSD, or is the manpage incomplete in
> IPFilter?
Manpage incomplete in IPFilter.
Darren
Index: natparse.c
===================================================================
RCS file: /devel/CVS/IP-Filter/Attic/natparse.c,v
retrieving revision 1.17.2.27
diff -c -r1.17.2.27 natparse.c
*** natparse.c 2002/12/06 11:40:27 1.17.2.27
--- natparse.c 2003/01/21 11:26:15
***************
*** 590,595 ****
--- 590,597 ----
return &ipn;
if (ipn.in_redir != NAT_BIMAP && !strcasecmp(*cpp, "proxy")) {
+ u_short pport;
+
if (ipn.in_redir == NAT_BIMAP) {
fprintf(stderr, "%d: cannot use proxy with bimap\n",
linenum);
***************
*** 637,645 ****
} else
ipn.in_p = 0;
! if (dport && !portnum(dport, &ipn.in_dport, linenum))
return NULL;
! ipn.in_dport = htons(ipn.in_dport);
(void) strncpy(ipn.in_plabel, *cpp, sizeof(ipn.in_plabel));
cpp++;
--- 639,655 ----
} else
ipn.in_p = 0;
! if (dport && !portnum(dport, &pport, linenum))
return NULL;
! if (ipn.in_dcmp != 0) {
! if (pport != ipn.in_dport) {
! fprintf(stderr,
! "%d: mismatch in port numbers\n",
! linenum);
! return NULL;
! }
! } else
! ipn.in_dport = htons(pport);
(void) strncpy(ipn.in_plabel, *cpp, sizeof(ipn.in_plabel));
cpp++;
Index: printnat.c
===================================================================
RCS file: /devel/CVS/IP-Filter/Attic/printnat.c,v
retrieving revision 1.1.2.13
diff -c -r1.1.2.13 printnat.c
*** printnat.c 2002/12/06 11:40:27 1.1.2.13
--- printnat.c 2003/01/21 11:27:30
***************
*** 422,427 ****
--- 422,429 ----
}
if (*np->in_plabel) {
printf(" proxy port");
+ if (np->in_dcmp != 0)
+ np->in_dport = htons(np->in_dport);
if (np->in_dport != 0) {
if (pr != NULL)
sv = getservbyport(np->in_dport,