Changeset 254


Ignore:
Timestamp:
Oct 3, 2009, 12:01:57 AM (15 years ago)
Author:
george
Message:
  • Opraveno: Generování pravidel NATu pro rozdílovou aktualizaci.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/system/generators/nat_routerboard.php

    r248 r254  
    3737    echo($Subnet['Name'].'('.$Subnet['AddressRange'].'/'.$Subnet['Mask'].'), ');
    3838    $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']);
    39     $Range = $Range['From'].'-'.$Range['To'];
    40     $Items[] = array('chain' => 'srcnat', 'src-address' => $Subnet['AddressRange'].'/'.$Subnet['Mask'], 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name']);
     39    if($Subnet['ExtMask'] != 32) $Range = $Range['From'].'-'.$Range['To'];
     40      else $Range = $Range['From'];
     41    if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange'];
     42      else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask'];
     43    $Items[] = array('chain' => 'srcnat', 'src-address' => $Src, 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name']);
     44   
    4145    $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']);
    42     $Range = $Range['From'].'-'.$Range['To'];
    43     $Items[] = array('chain' => 'dstnat', 'dst-address' => $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask'], 'in-interface' => $InetInterface, 'action' => 'dst-nat',  'to-addresses' => $Range, 'comment' => $Subnet['Name']);
     46    if($Subnet['Mask'] != 32) $Range = $Range['From'].'-'.$Range['To'];
     47      else $Range = $Range['From'];
     48    if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange'];
     49      else $Dest = $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask'];
     50    $Items[] = array('chain' => 'dstnat', 'dst-address' => $Dest, 'in-interface' => $InetInterface, 'action' => 'dst-nat',  'to-addresses' => $Range, 'comment' => $Subnet['Name']);
    4451  }
    4552  echo("\n");
Note: See TracChangeset for help on using the changeset viewer.