Changeset 188
- Timestamp:
- Apr 5, 2009, 5:06:25 PM (16 years ago)
- Location:
- trunk/system/generators
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/nat_routerboard.php
r187 r188 30 30 $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']); 31 31 $Range = $Range['From'].'-'.$Range['To']; 32 $Commands[] = ' /ip firewall nat add chain=srcnat src-address -list='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' out-interface='.$InetInterface.' action=src-nat to-addresses='.$Range.' comment="'.$Subnet['Name'].'"';32 $Commands[] = ' /ip firewall nat add chain=srcnat src-address='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' out-interface='.$InetInterface.' action=src-nat to-addresses='.$Range.' comment="'.$Subnet['Name'].'"'; 33 33 $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']); 34 34 $Range = $Range['From'].'-'.$Range['To']; 35 $Commands[] = ' /ip firewall nat add chain=dstnat dst-address -list='.$Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask'].' in-interface='.$InetInterface.' action=dst-nat to-addresses='.$Range.' comment="'.$Subnet['Name'].'"';35 $Commands[] = ' /ip firewall nat add chain=dstnat dst-address='.$Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask'].' in-interface='.$InetInterface.' action=dst-nat to-addresses='.$Range.' comment="'.$Subnet['Name'].'"'; 36 36 } 37 37 echo("\n"); … … 47 47 $Command = '/usr/bin/ssh -l '.$Config['MainRouter']['UserName'].' -i id_dsa '.$Config['MainRouter']['HostName'].' "'.$Commands.'"'; 48 48 $Output = array(); 49 echo($Command."\n");49 //echo($Command."\n"); 50 50 exec($Command, $Output); 51 51 //array_pop($Output); -
trunk/system/generators/netwatch.php
r187 r188 14 14 $I = explode('.', $Subnet['AddressRange']); 15 15 $I = $I[2]; 16 $DbResult2 = $Database->query('SELECT * FROM hosts WHERE (IP LIKE "192.168.'.$I.'.%") AND (MAC != "00:00:00:00:00:00")ORDER BY IP');16 $DbResult2 = $Database->query('SELECT * FROM hosts WHERE (IP LIKE "192.168.'.$I.'.%") ORDER BY IP'); 17 17 while($Host = $DbResult2->fetch_assoc()) 18 18 { -
trunk/system/generators/traffic_shaping_routerboard.php
r187 r188 44 44 while($Subnet = $DbResult->fetch_assoc()) 45 45 { 46 $Commands[] = ' /ip firewall mangle add chain=inet-out src-address='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' out-interface='.$InetInterface.' action=jump jump-target=inet-out-'.$Subnet['Id']; 47 $Commands[] = ' /ip firewall mangle add chain=inet-in dst-address='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' in-interface='.$InetInterface.' action=jump jump-target=inet-in-'.$Subnet['Id']; 46 $SubnetParts = explode('.', $Subnet['AddressRange']); 47 $SubnetNumber = $SubnetParts[2]; 48 $Commands[] = ' /ip firewall mangle add chain=inet-out src-address='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' out-interface='.$InetInterface.' action=jump jump-target=inet-out-'.$SubnetNumber; 49 $Commands[] = ' /ip firewall mangle add chain=inet-in dst-address='.$Subnet['AddressRange'].'/'.$Subnet['Mask'].' in-interface='.$InetInterface.' action=jump jump-target=inet-in-'.$SubnetNumber; 48 50 } 49 51 … … 73 75 $Commands[] = ' /queue tree add name='.$Member['Name'].'-in limit-at='.$SpeedOut.' max-limit='.$UserMaxSpeedOut.' parent=main-in queue=wireless-default'; 74 76 75 $DbResult2 = $Database->select('hosts', 'COUNT(*)', '(block = 0) AND (MAC != "") AND (user = '.$Member['Id'].')');77 $DbResult2 = $Database->select('hosts', 'COUNT(*)', '(block = 0) AND (MAC != "")'); 76 78 $Row = $DbResult2->fetch_array(); 77 79 $HostCount = $Row[0];
Note:
See TracChangeset
for help on using the changeset viewer.