Changeset 275 for trunk/system/generators/firewall_nat.php
- Timestamp:
- Jan 24, 2010, 8:05:10 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/firewall_nat.php
r272 r275 33 33 $DbResult2 = $Database->select('NetworkSubnet', '*', 'Member='.$Member['Id']); 34 34 while($Subnet = $DbResult2->fetch_assoc()) 35 { 35 { 36 36 $Subnet['Name'] = RouterOSIdent('subnet-'.$Subnet['Name']); 37 37 echo($Subnet['Name'].'('.$Subnet['AddressRange'].'/'.$Subnet['Mask'].'), '); 38 $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']); 38 $NewAddress = new NetworkAddressIPv4(); 39 $NewAddress->AddressFromString($Subnet['ExtAddressRange']); 40 $NewAddress->Prefix = $Subnet['ExtMask']; 41 $Range = $NewAddress->GetRange(); 39 42 if($Subnet['ExtMask'] != 32) $Range = $Range['From'].'-'.$Range['To']; 40 43 else $Range = $Range['From']; … … 43 46 $Items[] = array('chain' => 'srcnat', 'src-address' => $Src, 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out'); 44 47 45 $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']); 48 $NewAddress = new NetworkAddressIPv4(); 49 $NewAddress->AddressFromString($Subnet['AddressRange']); 50 $NewAddress->Prefix = $Subnet['Mask']; 51 $Range = $NewAddress->GetRange(); 46 52 if($Subnet['Mask'] != 32) $Range = $Range['From'].'-'.$Range['To']; 47 53 else $Range = $Range['From'];
Note:
See TracChangeset
for help on using the changeset viewer.