diff options
author | Michael Larson <slioch@eng-140.vyatta.com> | 2008-02-05 16:13:28 -0800 |
---|---|---|
committer | Michael Larson <slioch@eng-140.vyatta.com> | 2008-02-05 16:13:28 -0800 |
commit | feaee77ba7c7003bac53c4858eab26ac339e6aa8 (patch) | |
tree | e138ef78aa6423976739084db89f68b67f6ecf35 /scripts | |
parent | f350c6bdc9d1fba54fc695039341c87eb50b573a (diff) | |
download | vyatta-wanloadbalance-feaee77ba7c7003bac53c4858eab26ac339e6aa8.tar.gz vyatta-wanloadbalance-feaee77ba7c7003bac53c4858eab26ac339e6aa8.zip |
changed port definition to be consistent with fw/nat (i.e. single port line allow multi-port configuration). init script fix
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-wanloadbalance.pl | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/scripts/vyatta-wanloadbalance.pl b/scripts/vyatta-wanloadbalance.pl index b41bab2..16fce02 100644 --- a/scripts/vyatta-wanloadbalance.pl +++ b/scripts/vyatta-wanloadbalance.pl @@ -103,26 +103,17 @@ sub write_rules { print FILE_LCK "\t\tnetwork " . $option . "\n"; } - $config->setLevel("load-balancing wan rule $rule destination port-number"); - my @dport_nums = $config->listNodes(); - foreach my $dport_num (@dport_nums) { + $config->setLevel("load-balancing wan rule $rule destination port"); + my @dport = $config->listNodes(); + foreach my $dp (@dport) { if ($protocol ne "tcp" && $protocol ne "udp") { print "Please specify protocol tcp or udp when configuring ports\n"; exit 2; } - print FILE_LCK "\t\tport-number " . $dport_num . "\n"; + print FILE_LCK "\t\tport " . $dp . "\n"; } - $config->setLevel("load-balancing wan rule $rule destination port-name"); - my @dport_names = $config->listNodes(); - foreach my $dport_name (@dport_names) { - if ($protocol ne "tcp" && $protocol ne "udp") { - print "Please specify protocol tcp or udp when configuring ports\n"; - exit 2; - } - print FILE_LCK "\t\tport-name " . $dport_name . "\n"; - } print FILE_LCK "\t}\n"; #source @@ -137,26 +128,15 @@ sub write_rules { print FILE_LCK "\t\tnetwork " . $option . "\n"; } - $config->setLevel("load-balancing wan rule $rule source port-number"); - my @sport_nums = $config->listNodes(); - foreach my $sport_num (@sport_nums) { - if ($protocol ne "tcp" && $protocol ne "udp") { - print "Please specify protocol tcp or udp when configuring ports\n"; - exit 2; - } - print FILE_LCK "\t\tport-number " . $sport_num . "\n"; - } - - $config->setLevel("load-balancing wan rule $rule source port-name"); - my @sport_names = $config->listNodes(); - foreach my $sport_name (@sport_names) { + $config->setLevel("load-balancing wan rule $rule source port"); + my @sports = $config->listNodes(); + foreach my $sp (@sports) { if ($protocol ne "tcp" && $protocol ne "udp") { print "Please specify protocol tcp or udp when configuring ports\n"; exit 2; } - print FILE_LCK "\t\tport-name " . $sport_name . "\n"; + print FILE_LCK "\t\tports " . $sp . "\n"; } - print FILE_LCK "\t}\n"; #interface $config->setLevel("load-balancing wan rule $rule interface"); |