|
From: Charlie B. <cha...@bu...> - 2005-05-12 01:40:47
|
I seem to have found some parsing errors in to-destination. The pod tells
me that to-destination can be any of:
...
ad.d.re.ss
ad.d.re.ss-ad.d.re.ss
ad.d.re.ss:port
ad.d.re.ss:port-port
ad.d.re.ss-ad.d.re.ss:port
ad.d.re.ss-ad.d.re.ss:port-port
:port
:port-port
...
I find that none matching port-port is accepted.
$ sudo perl /tmp/forwarding.pl 1.2.3.4
$ sudo perl /tmp/forwarding.pl 1.2.3.4:50
$ sudo perl /tmp/forwarding.pl 1.2.3.4:50-60
append: nat: 1.2.3.4:50-60 to-destination: Unable to parse value at
/tmp/forwarding.pl line 12.
$ sudo perl /tmp/forwarding.pl 1.2.3.4
$ sudo perl /tmp/forwarding.pl 1.2.3.4-1.2.3.5
$ sudo perl /tmp/forwarding.pl 1.2.3.4:50
$ sudo perl /tmp/forwarding.pl 1.2.3.4:50-60
append: nat: 1.2.3.4:50-60 to-destination: Unable to parse value at
/tmp/forwarding.pl line 12.
$ sudo perl /tmp/forwarding.pl 1.2.3.4-1.2.3.5:50
$ sudo perl /tmp/forwarding.pl 1.2.3.4-1.2.3.5:50-60
append: nat: 1.2.3.4-1.2.3.5:50-60 to-destination: Unable to parse value
at /tmp/forwarding.pl line 12.
$ sudo perl /tmp/forwarding.pl :50
$ sudo perl /tmp/forwarding.pl :50-60
append: nat: :50-60 to-destination: Unable to parse value at
/tmp/forwarding.pl line 12.
This is the relevant bit of my test program:
...
$dest = shift;
$nat->append_entry('PortForwarding',
{
source => "1.2.3.4",
protocol => "tcp",
'destination-port' => 99,
jump => 'DNAT',
'to-destination' => "$dest",
}) or warn "append: nat: $dport $!";
...
|