Ignore:
Timestamp:
Apr 5, 2009, 5:06:25 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Generování nastavení routerů.
File:
1 edited

Legend:

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

    r187 r188  
    3030    $Range = CIDRToAddressRange($Subnet['ExtAddressRange'], $Subnet['ExtMask']);
    3131    $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'].'"';
    3333    $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']);
    3434    $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'].'"';
    3636  }
    3737  echo("\n");
     
    4747$Command = '/usr/bin/ssh -l '.$Config['MainRouter']['UserName'].' -i id_dsa '.$Config['MainRouter']['HostName'].' "'.$Commands.'"';
    4848$Output = array();
    49 echo($Command."\n");
     49//echo($Command."\n");
    5050exec($Command, $Output);
    5151//array_pop($Output);
Note: See TracChangeset for help on using the changeset viewer.