Changeset 276 for trunk/system/generators/firewall_nat.php
- Timestamp:
- Jan 24, 2010, 9:21:28 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/generators/firewall_nat.php
r275 r276 4 4 include('../../global.php'); 5 5 include('../routerboard.php'); 6 include('common.php'); 6 7 $Path = array('ip', 'firewall', 'nat'); 7 8 … … 40 41 $NewAddress->Prefix = $Subnet['ExtMask']; 41 42 $Range = $NewAddress->GetRange(); 42 if($Subnet['ExtMask'] != 32) $Range = $Range['From'] .'-'.$Range['To'];43 else $Range = $Range['From'] ;43 if($Subnet['ExtMask'] != 32) $Range = $Range['From']->AddressToStrin().'-'.$Range['To']->AddressToString(); 44 else $Range = $Range['From']->AddressToString(); 44 45 if($Subnet['Mask'] == 32) $Src = $Subnet['AddressRange']; 45 46 else $Src = $Subnet['AddressRange'].'/'.$Subnet['Mask']; … … 50 51 $NewAddress->Prefix = $Subnet['Mask']; 51 52 $Range = $NewAddress->GetRange(); 52 if($Subnet['Mask'] != 32) $Range = $Range['From'] .'-'.$Range['To'];53 else $Range = $Range['From'] ;53 if($Subnet['Mask'] != 32) $Range = $Range['From']->AddressToString().'-'.$Range['To']->AddressToString(); 54 else $Range = $Range['From']->AddressToString(); 54 55 if($Subnet['ExtMask'] == 32) $Dest = $Subnet['ExtAddressRange']; 55 56 else $Dest = $Subnet['ExtAddressRange'].'/'.$Subnet['ExtMask']; … … 65 66 $Items[] = array('chain' => 'dstnat', 'dst-address' => '212.111.4.174', 'protocol' => 'udp', 'dst-port' => 53, 'in-interface' => $InetInterface, 'action' => 'dst-nat', 'to-addresses' => '10.145.64.8', 'to-ports' => 53, 'comment' => 'DNS_redirection_UDP'); 66 67 68 //print_r($Items); 67 69 $Routerboard->ListUpdate($Path, array('chain', 'dst-address', 'in-interface', 'src-address', 'out-interface', 'to-ports', 'dst-port', 'protocol', 'action', 'to-addresses', 'comment'), $Items); 68 70
Note:
See TracChangeset
for help on using the changeset viewer.