Changeset 272 for trunk/system/generators/firewall_nat.php
- Timestamp:
- Jan 10, 2010, 5:02:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/firewall_nat.php
r266 r272 26 26 $Name = RouterOSIdent($Name); 27 27 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'); 30 30 } 31 31 … … 41 41 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 42 42 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'); 44 44 45 45 $Range = CIDRToAddressRange($Subnet['AddressRange'], $Subnet['Mask']); … … 48 48 if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange']; 49 49 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'); 51 51 } 52 52 echo("\n");
Note:
See TracChangeset
for help on using the changeset viewer.