Changeset 188 for trunk/system/generators/nat_routerboard.php
- Timestamp:
- Apr 5, 2009, 5:06:25 PM (16 years ago)
- File:
-
- 1 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);
Note:
See TracChangeset
for help on using the changeset viewer.