]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Merge remote-tracking branch 'amarx/vpn-statistic1' into next
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2015 16:37:18 +0000 (17:37 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jan 2015 16:37:18 +0000 (17:37 +0100)
1  2 
html/cgi-bin/firewall.cgi
html/cgi-bin/ovpnmain.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
lfs/openvpn

index badee6b3c02ac115f4d9eda0abc02ae928ebd896,0b587c57f919fee972b0e25655988af36abbc071..d2227a421ec795fff7e6506d12b0a0d3b6efda60
@@@ -161,22 -161,6 +161,22 @@@ print<<END
                        \$("#TIME_CONSTRAINTS").toggle();
                });
  
 +              // Limit concurrent connections per ip
 +              if(!\$("#USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP").attr("checked")) {
 +                      \$("#LIMIT_CON").hide();
 +              }
 +              \$("#USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP").change(function() {
 +                      \$("#LIMIT_CON").toggle();
 +              });
 +
 +              // Rate-limit new connections
 +              if(!\$("#USE_RATELIMIT").attr("checked")) {
 +                      \$("#RATELIMIT").hide();
 +              }
 +              \$("#USE_RATELIMIT").change(function() {
 +                      \$("#RATELIMIT").toggle();
 +              });
 +
                // Automatically select radio buttons when corresponding
                // dropdown menu changes.
                \$("select").change(function() {
@@@ -238,8 -222,8 +238,8 @@@ if ($fwdfwsettings{'ACTION'} eq 'saveru
                #check if we have an identical rule already
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        foreach my $key (sort keys %configinputfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configinputfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configinputfw{$key}[0],$configinputfw{$key}[2],$configinputfw{$key}[3],$configinputfw{$key}[4],$configinputfw{$key}[5],$configinputfw{$key}[6],$configinputfw{$key}[7],$configinputfw{$key}[8],$configinputfw{$key}[9],$configinputfw{$key}[10],$configinputfw{$key}[11],$configinputfw{$key}[12],$configinputfw{$key}[13],$configinputfw{$key}[14],$configinputfw{$key}[15],$configinputfw{$key}[17],$configinputfw{$key}[18],$configinputfw{$key}[19],$configinputfw{$key}[20],$configinputfw{$key}[21],$configinputfw{$key}[22],$configinputfw{$key}[23],$configinputfw{$key}[24],$configinputfw{$key}[25],$configinputfw{$key}[26],$configinputfw{$key}[27],$configinputfw{$key}[28],$configinputfw{$key}[29],$configinputfw{$key}[30],$configinputfw{$key}[31],$configinputfw{$key}[32],$configinputfw{$key}[33],$configinputfw{$key}[34],$configinputfw{$key}[35],$configinputfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
 -              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
 +              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $errormessage='';
                                $fwdfwsettings{'nosave2'} = 'on';
                my $maxkey=&General::findhasharraykey(\%configoutgoingfw);
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        foreach my $key (sort keys %configoutgoingfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configoutgoingfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'LOG'},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configoutgoingfw{$key}[0],$configoutgoingfw{$key}[2],$configoutgoingfw{$key}[3],$configoutgoingfw{$key}[4],$configoutgoingfw{$key}[5],$configoutgoingfw{$key}[6],$configoutgoingfw{$key}[7],$configoutgoingfw{$key}[8],$configoutgoingfw{$key}[9],$configoutgoingfw{$key}[10],$configoutgoingfw{$key}[11],$configoutgoingfw{$key}[12],$configoutgoingfw{$key}[13],$configoutgoingfw{$key}[14],$configoutgoingfw{$key}[15],$configoutgoingfw{$key}[17],$configoutgoingfw{$key}[18],$configoutgoingfw{$key}[19],$configoutgoingfw{$key}[20],$configoutgoingfw{$key}[21],$configoutgoingfw{$key}[22],$configoutgoingfw{$key}[23],$configoutgoingfw{$key}[24],$configoutgoingfw{$key}[25],$configoutgoingfw{$key}[26],$configoutgoingfw{$key}[27],$configoutgoingfw{$key}[28],$configoutgoingfw{$key}[29],$configoutgoingfw{$key}[30],$configoutgoingfw{$key}[31],$configoutgoingfw{$key}[32],$configoutgoingfw{$key}[33],$configoutgoingfw{$key}[34],$configoutgoingfw{$key}[35],$configoutgoingfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
 -              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
 +              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'} ) {
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $fwdfwsettings{'nosave2'} = 'on';
                                $errormessage='';
                if($fwdfwsettings{'oldrulenumber'} eq $fwdfwsettings{'rulepos'}){
                        #check if we have an identical rule already
                        foreach my $key (sort keys %configfwdfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                                if($fwdfwsettings{'oldruleremark'} ne $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'updatefwrule'} eq 'on' && $fwdfwsettings{'ruleremark'} ne '' && !&validremark($fwdfwsettings{'ruleremark'})){
                                                        $errormessage=$Lang::tr{'fwdfw err remark'}."<br>";
                if($fwdfwsettings{'rulepos'} > 0 && !$fwdfwsettings{'oldrulenumber'}){
                        $fwdfwsettings{'oldrulenumber'}=$maxkey;
                        foreach my $key (sort keys %configfwdfw){
 -                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'}"
 -                                      eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31]"){
 +                              if (   "$fwdfwsettings{'RULE_ACTION'},$fwdfwsettings{'ACTIVE'},$fwdfwsettings{'grp1'},$fwdfwsettings{$fwdfwsettings{'grp1'}},$fwdfwsettings{'grp2'},$fwdfwsettings{$fwdfwsettings{'grp2'}},$fwdfwsettings{'USE_SRC_PORT'},$fwdfwsettings{'PROT'},$fwdfwsettings{'ICMP_TYPES'},$fwdfwsettings{'SRC_PORT'},$fwdfwsettings{'USESRV'},$fwdfwsettings{'TGT_PROT'},$fwdfwsettings{'ICMP_TGT'},$fwdfwsettings{'grp3'},$fwdfwsettings{$fwdfwsettings{'grp3'}},$fwdfwsettings{'TIME'},$fwdfwsettings{'TIME_MON'},$fwdfwsettings{'TIME_TUE'},$fwdfwsettings{'TIME_WED'},$fwdfwsettings{'TIME_THU'},$fwdfwsettings{'TIME_FRI'},$fwdfwsettings{'TIME_SAT'},$fwdfwsettings{'TIME_SUN'},$fwdfwsettings{'TIME_FROM'},$fwdfwsettings{'TIME_TO'},$fwdfwsettings{'USE_NAT'},$fwdfwsettings{$fwdfwsettings{'nat'}},$fwdfwsettings{'dnatport'},$fwdfwsettings{'nat'},$fwdfwsettings{'LIMIT_CON_CON'},$fwdfwsettings{'concon'},$fwdfwsettings{'RATE_LIMIT'},$fwdfwsettings{'ratecon'},$fwdfwsettings{'RATETIME'}"
 +                                      eq "$configfwdfw{$key}[0],$configfwdfw{$key}[2],$configfwdfw{$key}[3],$configfwdfw{$key}[4],$configfwdfw{$key}[5],$configfwdfw{$key}[6],$configfwdfw{$key}[7],$configfwdfw{$key}[8],$configfwdfw{$key}[9],$configfwdfw{$key}[10],$configfwdfw{$key}[11],$configfwdfw{$key}[12],$configfwdfw{$key}[13],$configfwdfw{$key}[14],$configfwdfw{$key}[15],$configfwdfw{$key}[18],$configfwdfw{$key}[19],$configfwdfw{$key}[20],$configfwdfw{$key}[21],$configfwdfw{$key}[22],$configfwdfw{$key}[23],$configfwdfw{$key}[24],$configfwdfw{$key}[25],$configfwdfw{$key}[26],$configfwdfw{$key}[27],$configfwdfw{$key}[28],$configfwdfw{$key}[29],$configfwdfw{$key}[30],$configfwdfw{$key}[31],$configfwdfw{$key}[32],$configfwdfw{$key}[33],$configfwdfw{$key}[34],$configfwdfw{$key}[35],$configfwdfw{$key}[36]"){
                                                $errormessage.=$Lang::tr{'fwdfw err ruleexists'};
                                }
                        }
                }
                #check if we just close a rule
 -              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}) {
 +              if( $fwdfwsettings{'oldgrp1a'} eq  $fwdfwsettings{'grp1'} && $fwdfwsettings{'oldgrp1b'} eq $fwdfwsettings{$fwdfwsettings{'grp1'}} && $fwdfwsettings{'oldgrp2a'} eq  $fwdfwsettings{'grp2'} && $fwdfwsettings{'oldgrp2b'} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} &&  $fwdfwsettings{'oldgrp3a'} eq $fwdfwsettings{'grp3'} && $fwdfwsettings{'oldgrp3b'} eq  $fwdfwsettings{$fwdfwsettings{'grp3'}} && $fwdfwsettings{'oldusesrv'} eq $fwdfwsettings{'USESRV'} && $fwdfwsettings{'oldruleremark'} eq $fwdfwsettings{'ruleremark'} && $fwdfwsettings{'oldruletype'} eq $fwdfwsettings{'chain'}){
                        if($fwdfwsettings{'nosave'} eq 'on' && $fwdfwsettings{'updatefwrule'} eq 'on'){
                                $fwdfwsettings{'nosave2'} = 'on';
                                $errormessage='';
                        }
                }
 +              #check max concurrent connections per ip address
 +              if ($fwdfwsettings{'LIMIT_CON_CON'} eq 'ON'){
 +                      if (!($fwdfwsettings{'concon'} =~ /^(\d+)$/)) {
 +                              $errormessage.=$Lang::tr{'fwdfw err concon'};
 +                      }
 +              }else{
 +                      $fwdfwsettings{'concon'}='';
 +              }
 +              #check ratelimit value
 +              if ($fwdfwsettings{'RATE_LIMIT'} eq 'ON'){
 +                      if (!($fwdfwsettings{'ratecon'} =~ /^(\d+)$/)) {
 +                              $errormessage.=$Lang::tr{'fwdfw err ratecon'};
 +                      }
 +              }else{
 +                      $fwdfwsettings{'ratecon'}='';
 +              }
                #increase counters
                if (!$errormessage){
                        if ($fwdfwsettings{'nosave2'} ne 'on'){
@@@ -865,7 -833,7 +865,7 @@@ sub checkrul
                $errormessage.=$Lang::tr{'fwdfw err remark'}."<br>";
        }
        #check if source and target identical
-       if ($fwdfwsettings{$fwdfwsettings{'grp1'}} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ALL'){
+       if ($fwdfwsettings{$fwdfwsettings{'grp1'}} eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $fwdfwsettings{$fwdfwsettings{'grp1'}} ne 'ALL' && $fwdfwsettings{'grp2'} ne 'ipfire'){
                $errormessage=$Lang::tr{'fwdfw err same'};
                return $errormessage;
        }
@@@ -1096,6 -1064,7 +1096,6 @@@ print<<END
  END
        foreach my $network (sort keys %defaultNetworks)
                {
 -                      next if($defaultNetworks{$network}{'NAME'} eq "RED" && $srctgt eq 'src');
                        next if($defaultNetworks{$network}{'NAME'} eq "IPFire");
                        print "<option value='$defaultNetworks{$network}{'NAME'}'";
                        print " selected='selected'" if ($fwdfwsettings{$fwdfwsettings{$grp}} eq $defaultNetworks{$network}{'NAME'});
@@@ -1548,11 -1517,6 +1548,11 @@@ sub newrul
                                $fwdfwsettings{'nat'}                                   = $hash{$key}[31]; #changed order
                                $fwdfwsettings{$fwdfwsettings{'nat'}}   = $hash{$key}[29];
                                $fwdfwsettings{'dnatport'}                              = $hash{$key}[30];
 +                              $fwdfwsettings{'LIMIT_CON_CON'}                 = $hash{$key}[32];
 +                              $fwdfwsettings{'concon'}                                = $hash{$key}[33];
 +                              $fwdfwsettings{'RATE_LIMIT'}                    = $hash{$key}[34];
 +                              $fwdfwsettings{'ratecon'}                               = $hash{$key}[35];
 +                              $fwdfwsettings{'RATETIME'}                              = $hash{$key}[36];
                                $checked{'grp1'}{$fwdfwsettings{'grp1'}}                                = 'CHECKED';
                                $checked{'grp2'}{$fwdfwsettings{'grp2'}}                                = 'CHECKED';
                                $checked{'grp3'}{$fwdfwsettings{'grp3'}}                                = 'CHECKED';
                                $checked{'TIME_SUN'}{$fwdfwsettings{'TIME_SUN'}}                = 'CHECKED';
                                $checked{'USE_NAT'}{$fwdfwsettings{'USE_NAT'}}                  = 'CHECKED';
                                $checked{'nat'}{$fwdfwsettings{'nat'}}                                  = 'CHECKED';
 +                              $checked{'LIMIT_CON_CON'}{$fwdfwsettings{'LIMIT_CON_CON'}}      = 'CHECKED';
 +                              $checked{'RATE_LIMIT'}{$fwdfwsettings{'RATE_LIMIT'}}    = 'CHECKED';
                                $selected{'TIME_FROM'}{$fwdfwsettings{'TIME_FROM'}}             = 'selected';
                                $selected{'TIME_TO'}{$fwdfwsettings{'TIME_TO'}}                 = 'selected';
                                $selected{'ipfire'}{$fwdfwsettings{$fwdfwsettings{'grp2'}}} ='selected';
                                $selected{'ipfire_src'}{$fwdfwsettings{$fwdfwsettings{'grp1'}}} ='selected';
                                $selected{'dnat'}{$fwdfwsettings{'dnat'}}                               ='selected';
                                $selected{'snat'}{$fwdfwsettings{'snat'}}                               ='selected';
 +                              $selected{'RATETIME'}{$fwdfwsettings{'RATETIME'}}               ='selected';
                        }
                }
                $fwdfwsettings{'oldgrp1a'}=$fwdfwsettings{'grp1'};
                $fwdfwsettings{'oldruleremark'}=$fwdfwsettings{'ruleremark'};
                $fwdfwsettings{'oldnat'}=$fwdfwsettings{'USE_NAT'};
                $fwdfwsettings{'oldruletype'}=$fwdfwsettings{'chain'};
 +              $fwdfwsettings{'oldconcon'}=$fwdfwsettings{'LIMIT_CON_CON'};
 +              $fwdfwsettings{'olduseratelimit'}=$fwdfwsettings{'RATE_LIMIT'};
 +              $fwdfwsettings{'olduseratelimitamount'}=$fwdfwsettings{'ratecon'};
 +              $fwdfwsettings{'oldratelimittime'}=$fwdfwsettings{'RATETIME'};
 +
                #check if manual ip (source) is orange network
                if ($fwdfwsettings{'grp1'} eq 'src_addr'){
                        my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
                $fwdfwsettings{'oldusesrv'}=$fwdfwsettings{'USESRV'};
                $fwdfwsettings{'oldruleremark'}=$fwdfwsettings{'ruleremark'};
                $fwdfwsettings{'oldnat'}=$fwdfwsettings{'USE_NAT'};
 +              $fwdfwsettings{'oldconcon'}=$fwdfwsettings{'LIMIT_CON_CON'};
                #check if manual ip (source) is orange network
                if ($fwdfwsettings{'grp1'} eq 'src_addr'){
                        my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}});
                                        </table>
                                </td>
                        </tr>
 +                      <tr>
 +                              <td width='1%'>
 +                                      <input type='checkbox' name='LIMIT_CON_CON' id="USE_LIMIT_CONCURRENT_CONNECTIONS_PER_IP" value='ON' $checked{'LIMIT_CON_CON'}{'ON'}>
 +                              </td>
 +                              <td>$Lang::tr{'fwdfw limitconcon'}</td>
 +                      </tr>
 +                      <tr id="LIMIT_CON">
 +                              <td colspan='2'>
 +                                      <table width='66%' border='0'>
 +                                              <tr>
 +                                                      <td width="20em">&nbsp;</td>
 +                                                      <td>$Lang::tr{'fwdfw maxconcon'}: <input type='text' name='concon' size='2' value="$fwdfwsettings{'concon'}"></td>
 +                                              </tr>
 +                                      </table>
 +                              </td>
 +                      </tr>
 +                      <tr>
 +                              <td width='1%'>
 +                                      <input type='checkbox' name='RATE_LIMIT' id="USE_RATELIMIT" value='ON' $checked{'RATE_LIMIT'}{'ON'}>
 +                              </td>
 +                              <td>$Lang::tr{'fwdfw ratelimit'}</td>
 +                      </tr>
 +                      <tr id="RATELIMIT">
 +                              <td colspan='2'>
 +                                      <table width='66%' border='0'>
 +                                              <tr>
 +                                                      <td width="20em">&nbsp;</td>
 +                                                      <td>$Lang::tr{'fwdfw numcon'}: <input type='text' name='ratecon' size='2' value="$fwdfwsettings{'ratecon'}"> /
 +                                                              <select name='RATETIME' style='width:100px;'>
 +                                                                      <option value='second' $selected{'RATETIME'}{'second'}>$Lang::tr{'age second'}</option>
 +                                                                      <option value='minute' $selected{'RATETIME'}{'minute'}>$Lang::tr{'minute'}</option>
 +                                                                      <option value='hour' $selected{'RATETIME'}{'hour'}>$Lang::tr{'hour'}</option>
 +                                                              </select>
 +                                                      </td>
 +                                              </tr>
 +                                      </table>
 +                              </td>
 +                      </tr>
                </table>
                <br>
  END
@@@ -2127,7 -2044,6 +2127,7 @@@ EN
                        <input type='hidden' name='oldorange' value='$fwdfwsettings{'oldorange'}' />
                        <input type='hidden' name='oldnat' value='$fwdfwsettings{'oldnat'}' />
                        <input type='hidden' name='oldruletype' value='$fwdfwsettings{'oldruletype'}' />
 +                      <input type='hidden' name='oldconcon' value='$fwdfwsettings{'oldconcon'}' />
                        <input type='hidden' name='ACTION' value='saverule' ></form><form method='post' style='display:inline'><input type='submit' value='$Lang::tr{'fwhost back'}' style='min-width:100px;'><input type='hidden' name='ACTION' value'reset'></td></td>
                        </table></form>
  END
@@@ -2264,11 -2180,6 +2264,11 @@@ sub saverul
                        $$hash{$key}[29] = $fwdfwsettings{$fwdfwsettings{'nat'}};
                        $$hash{$key}[30] = $fwdfwsettings{'dnatport'};
                        $$hash{$key}[31] = $fwdfwsettings{'nat'};
 +                      $$hash{$key}[32] = $fwdfwsettings{'LIMIT_CON_CON'};
 +                      $$hash{$key}[33] = $fwdfwsettings{'concon'};
 +                      $$hash{$key}[34] = $fwdfwsettings{'RATE_LIMIT'};
 +                      $$hash{$key}[35] = $fwdfwsettings{'ratecon'};
 +                      $$hash{$key}[36] = $fwdfwsettings{'RATETIME'};
                        &General::writehasharray("$config", $hash);
                }else{
                        foreach my $key (sort {$a <=> $b} keys %$hash){
                                        $$hash{$key}[29] = $fwdfwsettings{$fwdfwsettings{'nat'}};
                                        $$hash{$key}[30] = $fwdfwsettings{'dnatport'};
                                        $$hash{$key}[31] = $fwdfwsettings{'nat'};
 +                                      $$hash{$key}[32] = $fwdfwsettings{'LIMIT_CON_CON'};
 +                                      $$hash{$key}[33] = $fwdfwsettings{'concon'};
 +                                      $$hash{$key}[34] = $fwdfwsettings{'RATE_LIMIT'};
 +                                      $$hash{$key}[35] = $fwdfwsettings{'ratecon'};
 +                                      $$hash{$key}[36] = $fwdfwsettings{'RATETIME'};
                                        last;
                                }
                        }
index 235ece5f8bf3ba25af3e2fb09afc8e3325dd5427,67a91a39eb27e8950592ae85670dbbe1ef93a506..1e074928f29507143d98d40ba0ab5deeec4b0c21
@@@ -70,9 -70,6 +70,9 @@@ my $configgrp="${General::swroot}/fwhos
  my $customnet="${General::swroot}/fwhosts/customnetworks";
  my $name;
  my $col="";
 +my $local_serverconf = "${General::swroot}/ovpn/scripts/server.conf.local";
 +my $local_clientconf = "${General::swroot}/ovpn/scripts/client.conf.local";
 +
  &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
  $cgiparams{'ENABLED'} = 'off';
  $cgiparams{'ENABLED_BLUE'} = 'off';
@@@ -97,33 -94,10 +97,33 @@@ $cgiparams{'DCIPHER'} = ''
  $cgiparams{'DAUTH'} = '';
  $cgiparams{'TLSAUTH'} = '';
  $routes_push_file = "${General::swroot}/ovpn/routes_push";
 -unless (-e $routes_push_file)    { system("touch $routes_push_file"); }
 -unless (-e "${General::swroot}/ovpn/ccd.conf")    { system("touch ${General::swroot}/ovpn/ccd.conf"); }
 -unless (-e "${General::swroot}/ovpn/ccdroute")    { system("touch ${General::swroot}/ovpn/ccdroute"); }
 -unless (-e "${General::swroot}/ovpn/ccdroute2")    { system("touch ${General::swroot}/ovpn/ccdroute2"); }
 +
 +# Add CCD files if not already presant
 +unless (-e $routes_push_file) {
 +      open(RPF, ">$routes_push_file");
 +      close(RPF);
 +}
 +unless (-e "${General::swroot}/ovpn/ccd.conf") {
 +      open(CCDC, ">${General::swroot}/ovpn/ccd.conf");
 +      close (CCDC);
 +}
 +unless (-e "${General::swroot}/ovpn/ccdroute") {
 +      open(CCDR, ">${General::swroot}/ovpn/ccdroute");
 +      close (CCDR);
 +}
 +unless (-e "${General::swroot}/ovpn/ccdroute2") {
 +      open(CCDRT, ">${General::swroot}/ovpn/ccdroute2");
 +      close (CCDRT);
 +}
 +# Add additional configs if not already presant
 +unless (-e "$local_serverconf") {
 +      open(LSC, ">$local_serverconf");
 +       close (LSC);
 +}
 +unless (-e "$local_clientconf") {
 +       open(LCC, ">$local_clientconf");
 +       close (LCC);
 +}
  
  &Header::getcgihash(\%cgiparams, {'wantfile' => 1, 'filevar' => 'FH'});
  
@@@ -288,7 -262,7 +288,7 @@@ sub writeserverconf 
        print CONF "keepalive $sovpnsettings{'KEEPALIVE_1'} $sovpnsettings{'KEEPALIVE_2'}\n";
      } 
      print CONF "status-version 1\n";
-     print CONF "status /var/log/ovpnserver.log 30\n";
+     print CONF "status /var/run/ovpnserver.log 30\n";
      print CONF "cipher $sovpnsettings{DCIPHER}\n";
      if ($sovpnsettings{'DAUTH'} eq '') {
          print CONF "";
                print CONF "verb $sovpnsettings{LOG_VERB}\n";
        } else {
                print CONF "verb 3\n";
 -      }       
 +      }
 +    # Print server.conf.local if entries exist to server.conf
 +    if ( !-z $local_serverconf  && $sovpnsettings{'ADDITIONAL_CONFIGS'} eq 'on') {
 +       open (LSC, "$local_serverconf");
 +               print CONF "\n#---------------------------\n";
 +               print CONF "# Start of custom directives\n";
 +               print CONF "# from server.conf.local\n";
 +               print CONF "#---------------------------\n\n";
 +       while (<LSC>) {
 +               print CONF $_;
 +       }
 +               print CONF "\n#-----------------------------\n";
 +               print CONF "# End of custom directives\n";
 +               print CONF "#-----------------------------\n";
 +       close (LSC);
 +    }
      print CONF "\n";
      
      close(CONF);
  }    
  
  sub emptyserverlog{
-     if (open(FILE, ">/var/log/ovpnserver.log")) {
+     if (open(FILE, ">/var/run/ovpnserver.log")) {
        flock FILE, 2;
        print FILE "";
        close FILE;
@@@ -726,7 -685,6 +726,7 @@@ if ($cgiparams{'ACTION'} eq $Lang::tr{'
      $vpnsettings{'MAX_CLIENTS'} = $cgiparams{'MAX_CLIENTS'};
      $vpnsettings{'REDIRECT_GW_DEF1'} = $cgiparams{'REDIRECT_GW_DEF1'};
      $vpnsettings{'CLIENT2CLIENT'} = $cgiparams{'CLIENT2CLIENT'};
 +    $vpnsettings{'ADDITIONAL_CONFIGS'} = $cgiparams{'ADDITIONAL_CONFIGS'};
      $vpnsettings{'DHCP_DOMAIN'} = $cgiparams{'DHCP_DOMAIN'};
      $vpnsettings{'DHCP_DNS'} = $cgiparams{'DHCP_DNS'};
      $vpnsettings{'DHCP_WINS'} = $cgiparams{'DHCP_WINS'};
@@@ -905,9 -863,12 +905,12 @@@ unless(-d "${General::swroot}/ovpn/n2nc
    print SERVERCONF "route $remsubnet[0] $remsubnet[1]\n";
    print SERVERCONF "# tun Device\n"; 
    print SERVERCONF "dev tun\n"; 
+   print SERVERCONF "#Logfile for statistics\n";
+   print SERVERCONF "status-version 1\n";
+   print SERVERCONF "status /var/run/openvpn/$cgiparams{'NAME'}-n2n 10\n";
    print SERVERCONF "# Port and Protokol\n"; 
    print SERVERCONF "port $cgiparams{'DEST_PORT'}\n"; 
-   
    if ($cgiparams{'PROTOCOL'} eq 'tcp') {
    print SERVERCONF "proto tcp-server\n";
    print SERVERCONF "# Packet size\n";
@@@ -1193,6 -1154,14 +1196,14 @@@ SETTINGS_ERROR
      while ($file = glob("${General::swroot}/ovpn/ccd/*")) {
        unlink $file
      }
+ # Delete all RRD files for Roadwarrior connections
+     chdir('/var/ipfire/ovpn/ccd');
+       while ($file = glob("*")) {
+       system ("/usr/local/bin/openvpnctrl -drrd $file");
+       }
+     while ($file = glob("${General::swroot}/ovpn/ccd/*")) {
+       unlink $file
+     }
      if (open(FILE, ">${General::swroot}/ovpn/ovpn-leases.db")) {
        print FILE "";
        close FILE;
@@@ -1245,7 -1214,8 +1256,7 @@@ EN
          unlink "${General::swroot}/ovpn/ca/$cgiparams{'DH_NAME'}";
        }
        # Create Diffie Hellmann Parameter
 -      system('/usr/bin/openssl', 'dhparam', '-rand', '/proc/interrupts:/proc/net/rt_cache',
 -      '-out', "${General::swroot}/ovpn/ca/dh1024.pem", "$cgiparams{'DHLENGHT'}");
 +      system('/usr/bin/openssl', 'dhparam', '-out', "${General::swroot}/ovpn/ca/dh1024.pem", "$cgiparams{'DHLENGHT'}");
        if ($?) {
                $errormessage = "$Lang::tr{'openssl produced an error'}: $?";
                unlink ("${General::swroot}/ovpn/ca/dh1024.pem");
@@@ -1798,7 -1768,7 +1809,7 @@@ EN
                goto ROOTCERT_ERROR;
            }
        } else {        # child
 -          unless (exec ('/usr/bin/openssl', 'req', '-x509', '-nodes', '-rand', '/proc/interrupts:/proc/net/rt_cache',
 +          unless (exec ('/usr/bin/openssl', 'req', '-x509', '-nodes',
                        '-days', '999999', '-newkey', 'rsa:4096', '-sha512',
                        '-keyout', "${General::swroot}/ovpn/ca/cakey.pem",
                        '-out', "${General::swroot}/ovpn/ca/cacert.pem",
                goto ROOTCERT_ERROR;
            }
        } else {        # child
 -          unless (exec ('/usr/bin/openssl', 'req', '-nodes', '-rand', '/proc/interrupts:/proc/net/rt_cache',
 +          unless (exec ('/usr/bin/openssl', 'req', '-nodes',
                        '-newkey', 'rsa:2048',
                        '-keyout', "${General::swroot}/ovpn/certs/serverkey.pem",
                        '-out', "${General::swroot}/ovpn/certs/serverreq.pem",
  #         &cleanssldatabase();
        }
        # Create Diffie Hellmann Parameter
 -      system('/usr/bin/openssl', 'dhparam', '-rand', '/proc/interrupts:/proc/net/rt_cache',
 -             '-out', "${General::swroot}/ovpn/ca/dh1024.pem", "$cgiparams{'DHLENGHT'}");
 +      system('/usr/bin/openssl', 'dhparam', '-out', "${General::swroot}/ovpn/ca/dh1024.pem", "$cgiparams{'DHLENGHT'}");
        if ($?) {
            $errormessage = "$Lang::tr{'openssl produced an error'}: $?";
            unlink ("${General::swroot}/ovpn/certs/serverkey.pem");
                print CLIENTCONF "mtu-disc $vpnsettings{'PMTU_DISCOVERY'}\r\n";
        }
      }
 +    # Print client.conf.local if entries exist to client.ovpn
 +    if (!-z $local_clientconf && $vpnsettings{'ADDITIONAL_CONFIGS'} eq 'on') {
 +       open (LCC, "$local_clientconf");
 +               print CLIENTCONF "\n#---------------------------\n";
 +               print CLIENTCONF "# Start of custom directives\n";
 +               print CLIENTCONF "# from client.conf.local\n";
 +               print CLIENTCONF "#---------------------------\n\n";
 +       while (<LCC>) {
 +               print CLIENTCONF $_;
 +       }
 +               print CLIENTCONF "\n#---------------------------\n";
 +               print CLIENTCONF "# End of custom directives\n";
 +               print CLIENTCONF "#---------------------------\n\n";
 +       close (LCC);
 +    }
      close(CLIENTCONF);
          
      $zip->addFile( "$tempdir/$clientovpn", $clientovpn) or die "Can't add file $clientovpn\n";
@@@ -2359,7 -2315,10 +2370,10 @@@ if ($confighash{$cgiparams{'KEY'}}[3] e
        
  # CCD end 
  
-       
+ ###
+ ###  Delete all RRD's for client
+ ###
+       system ("/usr/local/bin/openvpnctrl -drrd $confighash{$cgiparams{'KEY'}}[1]");
        delete $confighash{$cgiparams{'KEY'}};
        my $temp2 = `/usr/bin/openssl ca -gencrl -out ${General::swroot}/ovpn/crls/cacrl.pem -config ${General::swroot}/ovpn/openssl/ovpn.cnf`;
        &General::writehasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
@@@ -2513,9 -2472,6 +2527,9 @@@ ADV_ERROR
      $checked{'REDIRECT_GW_DEF1'}{'off'} = '';
      $checked{'REDIRECT_GW_DEF1'}{'on'} = '';
      $checked{'REDIRECT_GW_DEF1'}{$cgiparams{'REDIRECT_GW_DEF1'}} = 'CHECKED';
 +    $checked{'ADDITIONAL_CONFIGS'}{'off'} = '';
 +    $checked{'ADDITIONAL_CONFIGS'}{'on'} = '';
 +    $checked{'ADDITIONAL_CONFIGS'}{$cgiparams{'ADDITIONAL_CONFIGS'}} = 'CHECKED';
      $checked{'MSSFIX'}{'off'} = '';
      $checked{'MSSFIX'}{'on'} = '';
      $checked{'MSSFIX'}{$cgiparams{'MSSFIX'}} = 'CHECKED';
@@@ -2596,52 -2552,39 +2610,52 @@@ print <<END
  </table>
  <hr size='1'>
  <table width='100%'>
 -    <tr>
 +      <tr>
                <td class'base'><b>$Lang::tr{'misc-options'}</b></td>
 -    </tr>
 -    <tr>
 +      </tr>
 +
 +      <tr>
                <td width='20%'></td> <td width='15%'> </td><td width='15%'> </td><td width='15%'></td><td width='35%'></td>
 -    </tr>
 -    <tr>
 +      </tr>
 +
 +      <tr>
                <td class='base'>Client-To-Client</td>
                <td><input type='checkbox' name='CLIENT2CLIENT' $checked{'CLIENT2CLIENT'}{'on'} /></td>
 -    </tr>
 -    <tr>      
 +      </tr>
 +
 +      <tr>
                <td class='base'>Redirect-Gateway def1</td>
                <td><input type='checkbox' name='REDIRECT_GW_DEF1' $checked{'REDIRECT_GW_DEF1'}{'on'} /></td>
 -    </tr>
 -    <tr>      
 -        <td class='base'>Max-Clients</td>
 -        <td><input type='text' name='MAX_CLIENTS' value='$cgiparams{'MAX_CLIENTS'}' size='10' /></td>
 -    </tr>     
 +      </tr>
 +
        <tr>
 -        <td class='base'>Keepalive <br />
 -          (ping/ping-restart)</td>
 -        <td><input type='TEXT' name='KEEPALIVE_1' value='$cgiparams{'KEEPALIVE_1'}' size='10' /></td>
 -        <td><input type='TEXT' name='KEEPALIVE_2' value='$cgiparams{'KEEPALIVE_2'}' size='10' /></td>
 -    </tr>
 +              <td class='base'>$Lang::tr{'ovpn add conf'}</td>
 +              <td><input type='checkbox' name='ADDITIONAL_CONFIGS' $checked{'ADDITIONAL_CONFIGS'}{'on'} /></td>
 +              <td>$Lang::tr{'openvpn default'}: off</td>
 +      </tr>
 +
 +      <tr>
 +              <td class='base'>mssfix</td>
 +              <td><input type='checkbox' name='MSSFIX' $checked{'MSSFIX'}{'on'} /></td>
 +              <td>$Lang::tr{'openvpn default'}: off</td>
 +      </tr>
 +
        <tr>
 -        <td class='base'>fragment <br></td>
 -        <td><input type='TEXT' name='FRAGMENT' value='$cgiparams{'FRAGMENT'}' size='10' /></td>
 -      </tr>
 -      <tr>
 -        <td class='base'>mssfix</td>
 -        <td><input type='checkbox' name='MSSFIX' $checked{'MSSFIX'}{'on'} /></td>
 -        <td>$Lang::tr{'openvpn default'}: off</td>
 -        </tr>
 +              <td class='base'>fragment <br></td>
 +              <td><input type='TEXT' name='FRAGMENT' value='$cgiparams{'FRAGMENT'}' size='10' /></td>
 +      </tr>
 +
 +
 +      <tr>
 +              <td class='base'>Max-Clients</td>
 +              <td><input type='text' name='MAX_CLIENTS' value='$cgiparams{'MAX_CLIENTS'}' size='10' /></td>
 +      </tr>
 +      <tr>
 +              <td class='base'>Keepalive <br />
 +              (ping/ping-restart)</td>
 +              <td><input type='TEXT' name='KEEPALIVE_1' value='$cgiparams{'KEEPALIVE_1'}' size='10' /></td>
 +              <td><input type='TEXT' name='KEEPALIVE_2' value='$cgiparams{'KEEPALIVE_2'}' size='10' /></td>
 +      </tr>
  
        <tr>
                <td class='base'>$Lang::tr{'ovpn mtu-disc'}</td>
@@@ -2897,7 -2840,7 +2911,7 @@@ EN
      </tr>
  END
  ;
-       my $filename = "/var/log/ovpnserver.log";
+       my $filename = "/var/run/ovpnserver.log";
        open(FILE, $filename) or die 'Unable to open config file.';
        my @current = <FILE>;
        close(FILE);
@@@ -4085,10 -4028,6 +4099,10 @@@ if ($cgiparams{'TYPE'} eq 'net') 
                $errormessage = $Lang::tr{'passwords do not match'};
                goto VPNCONF_ERROR;
            }
 +          if ($cgiparams{'DAYS_VALID'} ne '' && $cgiparams{'DAYS_VALID'} !~ /^[0-9]+$/) {
 +              $errormessage = $Lang::tr{'invalid input for valid till days'};
 +              goto VPNCONF_ERROR;
 +          }
  
            # Replace empty strings with a .
            (my $ou = $cgiparams{'CERT_OU'}) =~ s/^\s*$/\./;
                    goto VPNCONF_ERROR;
                }
            } else {    # child
 -              unless (exec ('/usr/bin/openssl', 'req', '-nodes', '-rand', '/proc/interrupts:/proc/net/rt_cache',
 +              unless (exec ('/usr/bin/openssl', 'req', '-nodes',
                        '-newkey', 'rsa:2048',
                        '-keyout', "${General::swroot}/ovpn/certs/$cgiparams{'NAME'}key.pem",
                        '-out', "${General::swroot}/ovpn/certs/$cgiparams{'NAME'}req.pem",
        $cgiparams{'CERT_CITY'}         = $vpnsettings{'ROOTCERT_CITY'};
        $cgiparams{'CERT_STATE'}        = $vpnsettings{'ROOTCERT_STATE'};
        $cgiparams{'CERT_COUNTRY'}      = $vpnsettings{'ROOTCERT_COUNTRY'};
 +      $cgiparams{'DAYS_VALID'}        = $vpnsettings{'DAYS_VALID'};
      }
  
      VPNCONF_ERROR:
  
  if ($cgiparams{'TYPE'} eq 'host') {
        print <<END;
 -          </select></td></tr>
 -
 -      <td>&nbsp;</td><td class='base'>$Lang::tr{'valid till'} (days):</td>
 -      <td class='base' nowrap='nowrap'><input type='text' name='DAYS_VALID' value='$cgiparams{'DAYS_VALID'}' size='32' $cakeydisabled /></td></tr>
 -   <tr><td>&nbsp;</td>
 +      </select></td></tr>
 +              <td>&nbsp;</td><td class='base'>$Lang::tr{'valid till'} (days):</td>
 +              <td class='base' nowrap='nowrap'><input type='text' name='DAYS_VALID' value='$cgiparams{'DAYS_VALID'}' size='32' $cakeydisabled /></td></tr>
 +              <tr><td>&nbsp;</td>
                <td class='base'>$Lang::tr{'pkcs12 file password'}:</td>
                <td class='base' nowrap='nowrap'><input type='password' name='CERT_PASS1' value='$cgiparams{'CERT_PASS1'}' size='32' $cakeydisabled /></td></tr>
 -          <tr><td>&nbsp;</td><td class='base'>$Lang::tr{'pkcs12 file password'}:<br>($Lang::tr{'confirmation'})</td>
 +              <tr><td>&nbsp;</td><td class='base'>$Lang::tr{'pkcs12 file password'}:<br>($Lang::tr{'confirmation'})</td>
                <td class='base' nowrap='nowrap'><input type='password' name='CERT_PASS2' value='$cgiparams{'CERT_PASS2'}' size='32' $cakeydisabled /></td></tr>
 -     <tr><td colspan='3'>&nbsp;</td></tr>
 -     <tr><td colspan='3'><hr /></td></tr>
 -     <tr><td class='base' colspan='3' align='left'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td></tr>
 -     </table>
 +              <tr><td colspan='3'>&nbsp;</td></tr>
 +              <tr><td colspan='3'><hr /></td></tr>
 +              <tr><td class='base' colspan='3' align='left'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td></tr>
 +      </table>
  END
  }else{
        print <<END;
 -          </select></td></tr>
 -   <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 -       <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 -       <tr><td colspan='3'><hr /></td></tr>
 -       <tr><td class='base' colspan='3' align='left'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td></tr>
 +      </select></td></tr>
 +              <td>&nbsp;</td><td class='base'>$Lang::tr{'valid till'} (days):</td>
 +              <td class='base' nowrap='nowrap'><input type='text' name='DAYS_VALID' value='$cgiparams{'DAYS_VALID'}' size='32' $cakeydisabled /></td></tr>
 +              <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 +              <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
 +              <tr><td colspan='3'><hr /></td></tr>
 +              <tr><td class='base' colspan='3' align='left'><img src='/blob.gif' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td></tr>
         </table>
   
  END
@@@ -4897,7 -4834,7 +4911,7 @@@ EN
      &General::readhasharray("${General::swroot}/ovpn/caconfig", \%cahash);
      &General::readhasharray("${General::swroot}/ovpn/ovpnconfig", \%confighash);
  
-     my @status = `/bin/cat /var/log/ovpnserver.log`;
+     my @status = `/bin/cat /var/run/ovpnserver.log`;
  
      if ($cgiparams{'VPN_IP'} eq '' && -e "${General::swroot}/red/active") {
                if (open(IPADDR, "${General::swroot}/red/local-ipaddress")) {
diff --combined langs/de/cgi-bin/de.pl
index 3f96a60f1c9617f183f67f225c7846687458626b,1e75e3ab4a8391921074ce40851ced69358005d9..bf0165129c2a7b1a392dbd2fdfbda71ef995222f
  'fwdfw dnat porterr' => 'Für NAT-Regeln muss ein einzelner Port oder Portbereich angegeben werden.',
  'fwdfw dnat porterr2' => 'Externer Port (NAT) darf nur angegeben werden, wenn ein Ziel-Port definiert ist.',
  'fwdfw edit' => 'Bearbeiten',
 +'fwdfw err concon' => 'Ungültige Zahl für gleichzeitige Verbindungen',
  'fwdfw err nosrc' => 'Keine Quelle ausgewählt',
  'fwdfw err nosrcip' => 'Bitte Quell-IP-Adresse angeben',
  'fwdfw err notgt' => 'Kein Ziel ausgewählt',
  'fwdfw err notgtip' => 'Bitte Ziel-IP-Adresse angeben',
  'fwdfw err prot_port' => 'Bei dem gewählten Protokoll sind Quell- und Zielport nicht erlaubt',
  'fwdfw err prot_port1' => 'Bei Nutzung von Quell- oder Zielport muss als Protokoll TCP oder UDP gewählt werden.',
 +'fwdfw err ratecon' => 'Ungültiger Wert bei Anzahl der Verbindungen für Ratenlimitierung',
  'fwdfw err remark' => 'Die Bemerkung enthält ungültige Zeichen',
  'fwdfw err ruleexists' => 'Eine identische Regel existiert bereits',
  'fwdfw err same' => 'Quelle und Ziel sind identisch',
  'fwdfw hint mac' => 'Sie nutzen MAC-Adressen in der Zielgruppe. Diese werden bei der Regelerstellung übersprungen.',
  'fwdfw iface' => 'Interface',
  'fwdfw ipsec network' => 'IPsec-Netzwerke:',
 +'fwdfw limitconcon' => 'Beschränke gleichzeitige Verbindungen je IP-Adresse',
  'fwdfw log' => 'Log',
  'fwdfw log rule' => 'Logging aktivieren',
  'fwdfw man port' => 'Port(s):',
  'fwdfw many' => 'Diverse',
 +'fwdfw maxconcon' => 'Max. gleichzeitige Verbindungen',
  'fwdfw menu' => 'Firewall',
  'fwdfw movedown' => 'Herunter',
  'fwdfw moveup' => 'Herauf',
  'fwdfw natport used' => 'Der eingegebene Port wird bereits von einer anderen DNAT-Regel benutzt.',
  'fwdfw newrule' => 'Neue Regel erstellen',
 +'fwdfw numcon' => 'Anzahl der Verbindungen',
  'fwdfw p2p txt' => 'P2P-Netzwerke erlauben/verbieten.',
  'fwdfw pol allow' => 'Zugelassen',
  'fwdfw pol block' => 'Blockiert',
  'fwdfw pol title' => 'Standardverhalten der Firewall',
  'fwdfw prot41' => 'IPv6 Encapsulation (Protokoll 41)',
  'fwdfw prot41 short' => 'IPv6 Encap',
 +'fwdfw ratelimit' => 'Ratenlimitierung für neue Verbindungen',
  'fwdfw red' => 'ROT',
  'fwdfw reread' => 'Änderungen übernehmen',
  'fwdfw rule action' => 'Regelaktion:',
  'fwhost err remark' => 'Ungültige Bemerkung. Erlaubte Zeichen: Klein- und Großbuchstaben, Bindestrich, Unterstrich, Runde Klammern, Semikolon, Punkt.',
  'fwhost err srv exists' => 'Ein Service mit diesem Namen existiert bereits',
  'fwhost err srvexist' => 'Dieser Dienst ist bereits in der Gruppe',
 -'fwhost err sub32' => 'Bitte einen einzelnen Host hinzufügen, keine Netzwerke',
 +'fwhost err sub32' => 'Bitte Netzwerke hinzufügen, keinen einzelnen Host',
  'fwhost green' => 'Grün',
  'fwhost hint' => 'Hinweis',
  'fwhost hosts' => 'Firewall-Hosts',
  'incoming' => 'eingehend',
  'incoming firewall access' => 'Eingehender Firewallzugang',
  'incoming traffic in bytes per second' => 'Eingehender Verkehr',
+ 'incoming overhead in bytes per second' => 'Eingehender Overhead',
+ 'incoming compression in bytes per second' => 'Eingehende Kompression',
  'incorrect password' => 'Fehlerhaftes Passwort',
  'info' => 'Info',
  'init string' => 'Initialisierung:',
  'invalid input for organization' => 'Ungültige Eingabe für Organisation',
  'invalid input for remote host/ip' => 'Ungültige Eingabe für Remote Host/IP',
  'invalid input for state or province' => 'Ungültige Eingabe für Bundesstaat oder Provinz.',
 +'invalid input for valid till days' => 'Ungültige Eingabe für Gültig bis (Tage).',
  'invalid ip' => 'Ungültige IP-Adresse',
  'invalid keep time' => 'Die Aufbewahrungszeit muss eine gültige Zahl sein',
  'invalid key' => 'Ungültiger Schlüssel.',
  'outgoing firewall view group' => 'Gruppe anzeigen',
  'outgoing firewall warning' => 'Nur die Auswahl Quell IP / MAC aktiviert diese',
  'outgoing traffic in bytes per second' => 'Abgehender Verkehr',
+ 'outgoing overhead in bytes per second' => 'Abgehender Overhead',
+ 'outgoing compression in bytes per second' => 'Abgehende Kompression',
  'override mtu' => 'Überschreibe Standard MTU',
  'ovpn' => 'OpenVPN',
 +'ovpn add conf' => 'Erweiterte Konfiguration',
  'ovpn con stat' => 'OpenVPN Verbindungs-Statistik',
  'ovpn config' => 'OVPN-Konfiguration',
  'ovpn crypt options' => 'Kryptografieoptionen',
diff --combined langs/en/cgi-bin/en.pl
index ad331b20e26cae54b9ad8e4eeb43600790b25030,4cbe5024137a7cf3c8a4dfcc1f09026b254d5933..3ae4797764e445962cc0d18ba0be5742e2f867d1
  'fwdfw dnat porterr' => 'You have to select a single port or portrange (tcp/udp) for NAT',
  'fwdfw dnat porterr2' => 'Cannot use external port (NAT) when no destination port is defined.',
  'fwdfw edit' => 'Edit',
 +'fwdfw err concon' => 'Invalid number for concurrent connections',
  'fwdfw err nosrc' => 'No source selected.',
  'fwdfw err nosrcip' => 'Please provide a source IP address.',
  'fwdfw err notgt' => 'No destination selected.',
  'fwdfw err notgtip' => 'Please provide a destination IP address.',
  'fwdfw err prot_port' => 'Source- or targetport are not allowed with selected protocol',
  'fwdfw err prot_port1' => 'When using Source- or targetport you have to select TCP or UDP for protocol',
 +'fwdfw err ratecon' => 'Invalid value for connections in Rate-limit',
  'fwdfw err remark' => 'Invalid characters in remark.',
  'fwdfw err ruleexists' => 'This rule already exists.',
  'fwdfw err same' => 'Source and destination are identical.',
  'fwdfw hint mac' => 'The destination group contains MAC addresses, which will be skipped during rule creation.',
  'fwdfw iface' => 'Interface',
  'fwdfw ipsec network' => 'IPsec networks:',
 +'fwdfw limitconcon' => 'Limit concurrent connections per IP address',
  'fwdfw log' => 'Log',
  'fwdfw log rule' => 'Log rule',
  'fwdfw man port' => 'Port(s):',
  'fwdfw many' => 'Many',
 +'fwdfw maxconcon' => 'Max. concurrent connections',
  'fwdfw menu' => 'Firewall',
  'fwdfw movedown' => 'Move down',
  'fwdfw moveup' => 'Move up',
  'fwdfw natport used' => 'The given port for NAPT is already in use by an other DNAT rule.',
  'fwdfw newrule' => 'New rule',
 +'fwdfw numcon' => 'Number of connections',
  'fwdfw p2p txt' => 'Grant/deny access to P2P networks.',
  'fwdfw pol allow' => 'Allowed',
  'fwdfw pol block' => 'Blocked',
  'fwdfw pol title' => 'Default firewall behaviour',
  'fwdfw prot41' => 'IPv6 Encapsulation (Protocol 41)',
  'fwdfw prot41 short' => 'IPv6 Encap',
 +'fwdfw ratelimit' => 'Rate-limit new connections',
  'fwdfw red' => 'RED',
  'fwdfw reread' => 'Apply changes',
  'fwdfw rule action' => 'Rule action:',
  'fwhost err remark' => 'Invalid remark. Allowed characters: Upper- and lowercase letters, digits, space, dash, braces, semicolon, pipe and dot.',
  'fwhost err srv exists' => 'A service with the same name already exists',
  'fwhost err srvexist' => 'This service already exists in the group',
 -'fwhost err sub32' => 'Please add a single host, not a network.',
 +'fwhost err sub32' => 'Please add a network, not a single host',
  'fwhost green' => 'Green',
  'fwhost hint' => 'Note',
  'fwhost hosts' => 'Firewall Hosts',
  'incoming' => 'incoming',
  'incoming firewall access' => 'Incoming Firewall Access',
  'incoming traffic in bytes per second' => 'Incoming Traffic',
+ 'incoming overhead in bytes per second' => 'Incoming Overhead',
+ 'incoming compression in bytes per second' => 'Incoming Compression',
  'incorrect password' => 'Incorrect password',
  'info' => 'Info',
  'init string' => 'Init:',
  'invalid input for organization' => 'Invalid input for organization',
  'invalid input for remote host/ip' => 'Invalid input for remote host/ip.',
  'invalid input for state or province' => 'Invalid input for state or province.',
 +'invalid input for valid till days' => 'Invalid input for Valid till (days).',
  'invalid ip' => 'Invalid IP Address',
  'invalid keep time' => 'Keep time must be a valid number',
  'invalid key' => 'Invalid key.',
  'outgoing firewall view group' => 'View group',
  'outgoing firewall warning' => 'Not selecting source ip or mac ignores them',
  'outgoing traffic in bytes per second' => 'Outgoing Traffic',
+ 'outgoing overhead in bytes per second' => 'Outgoing Overhead',
+ 'outgoing compression in bytes per second' => 'Outgoing compression',
  'override mtu' => 'Override default MTU',
  'ovpn' => 'OpenVPN',
 +'ovpn add conf' => 'Additional configuration',
  'ovpn con stat' => 'OpenVPN Connection Statistics',
  'ovpn config' => 'OVPN-Config',
  'ovpn crypt options' => 'Cryptographic options',
  'swap usage per' => 'Swap usage per',
  'system' => 'System',
  'system graphs' => 'System Graphs',
 -'system has hwrng' => 'This system has got a hardware random number generator.',
 -'system has rdrand' => 'This system has got support for Intel(R) RDRAND.',
 +'system has hwrng' => 'This system has a hardware random number generator.',
 +'system has rdrand' => 'This system has support for Intel(R) RDRAND.',
  'system information' => 'System Information',
  'system log viewer' => 'System Log Viewer',
  'system logs' => 'System Logs',
diff --combined lfs/openvpn
index 44a8b469785b2fd916b91b7f929063fc055046d1,68c69a2e9c52b65369153dab9218a5677431d6cd..487b6cab4285a4b9750a6a8573263a509ac72e97
@@@ -24,7 -24,7 +24,7 @@@
  
  include Config
  
 -VER        = 2.3.4
 +VER        = 2.3.6
  
  THISAPP    = openvpn-$(VER)
  DL_FILE    = $(THISAPP).tar.xz
@@@ -40,7 -40,7 +40,7 @@@ objects = $(DL_FILE
  
  $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
  
 -$(DL_FILE)_MD5 = 9b70be9fb45e407117c3c9b118e4ba22
 +$(DL_FILE)_MD5 = bcc30c296566df14feebdd8aa0e408ca
  
  install : $(TARGET)
  
@@@ -83,6 -83,7 +83,7 @@@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(
        cd $(DIR_APP) && make install
        cd $(DIR_APP) && cp -Rvf $(DIR_SRC)/config/ovpn /var/ipfire
        -mkdir -vp /usr/lib/openvpn/plugins
+       -mkdir -vp /var/log/openvpn
        -mkdir -vp /var/ipfire/ovpn/ca
        -mkdir -vp /var/ipfire/ovpn/ccd
        -mkdir -vp /var/ipfire/ovpn/crls