Ignore:
Timestamp:
Jan 10, 2010, 5:02:00 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Zobrazení výpisů finančních operací klientů dle roků.
  • Přidáno: Skript pro periodickou kontrolu adres DHCP serverů a zajištění přenositelnosti IP adres klientů.
File:
1 edited

Legend:

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

    r266 r272  
    2626    $Name = RouterOSIdent($Name);
    2727    echo($Name.'('.$Interface['LocalIP'].'), ');
    28     $Items[] = array('chain' => 'srcnat', 'src-address' => $Interface['LocalIP'], 'out-interface' => $InetInterface, 'action' => 'src-nat',  'to-addresses' => $Interface['ExternalIP'], 'comment' => $Name);
    29     $Items[] = array('chain' => 'dstnat', 'dst-address' => $Interface['ExternalIP'], 'in-interface' => $InetInterface, 'action' => 'dst-nat', 'to-addresses' => $Interface['LocalIP'], 'comment' => $Name);
     28    $Items[] = array('chain' => 'srcnat', 'src-address' => $Interface['LocalIP'], 'out-interface' => $InetInterface, 'action' => 'src-nat',  'to-addresses' => $Interface['ExternalIP'], 'comment' => $Name.'-out');
     29    $Items[] = array('chain' => 'dstnat', 'dst-address' => $Interface['ExternalIP'], 'in-interface' => $InetInterface, 'action' => 'dst-nat', 'to-addresses' => $Interface['LocalIP'], 'comment' => $Name.'-in');
    3030  }
    3131
     
    4141    if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange'];
    4242      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']);
     43    $Items[] = array('chain' => 'srcnat', 'src-address' => $Src, 'out-interface' => $InetInterface, 'action' => 'src-nat', 'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-out');
    4444   
    4545    $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']);
     
    4848    if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange'];
    4949      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']);
     50    $Items[] = array('chain' => 'dstnat', 'dst-address' => $Dest, 'in-interface' => $InetInterface, 'action' => 'dst-nat',  'to-addresses' => $Range, 'comment' => $Subnet['Name'].'-in');
    5151  }
    5252  echo("\n");
Note: See TracChangeset for help on using the changeset viewer.