Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/NetworkConfigLinux/Generators/IPTables.php

    r548 r738  
    1313/*
    1414// Blocking according IP address
    15 $DbResult = $Database->select('users', '*', 'inet = 0'); 
     15$DbResult = $Database->select('users', '*', 'inet = 0');
    1616while($User = $DbResult->fetch_array())
    1717{
     
    4848      //    else exec('/sbin/iptables -t nat -A Block -m mac --mac-source '.$Row['MAC']." -j Local");
    4949    } else {
    50       if($Row['vpn'] == 0) 
     50      if($Row['vpn'] == 0)
    5151      {
    52         $CZFreeLocalIP = $Row['IP'];
     52  $CZFreeLocalIP = $Row['IP'];
    5353        //echo($Row['external_ip']."\n");
    54         //if($Row['name'] == 'TBC')
    55         //{
     54  //if($Row['name'] == 'TBC')
     55  //{
    5656        //  exec('/sbin/iptables -t nat -A PreroutingDNAT -m tcp -p tcp --dport 3724 -d '.$Row['external_ip'].' -j DNAT --to-destination '.$Row['IP'].':3725');
    5757        //  exec('/sbin/iptables -t nat -A POSTROUTING -m tcp -p tcp -s '.$Row['IP'].' --sport 3725 -o '.$InetInterface.' -j SNAT --to-source '.$Row['external_ip'].':3724');
    58         //}
     58  //}
    5959        if(strtolower($Row['name']) != 'gate')
    60         {
    61           if($Row['external_ip'] != '')
     60  {
     61      if($Row['external_ip'] != '')
    6262          {
    6363            echo($Row['name'].'='.$Row['external_ip']."\n");
    64            
     64
    6565            exec('/sbin/iptables -t nat -A PreroutingDNAT -i '.$InetInterface.' -d '.$Row['external_ip'].' -j DNAT --to-destination '.$Row['IP']);
    6666            exec('/sbin/iptables -t nat -A PreroutingDNAT -i '.$InetInterface.' -d '.$Row['external_ip'].' -j ACCEPT');
    6767            exec('/sbin/iptables -t nat -A POSTROUTING -s '.$Row['IP'].' -o '.$InetInterface.' -j SNAT --to-source '.$Row['external_ip']);
    68           }
     68      }
    6969          //exec('/sbin/iptables -t nat -A Block -m mac --mac-source '.$Row['MAC']." -j Proxy");
    70         }
     70  }
    7171      }
    7272      else
    7373      {
    74         $CZFreeLocalIP = $Row['external_ip'];
     74  $CZFreeLocalIP = $Row['external_ip'];
    7575 //echo('vpn');
    7676        //exec('/sbin/iptables -t nat -A PreroutingDNAT -s '.$Row['IP'].' -p udp -m udp --dport 55556 -j DROP');
     
    7979
    8080        //if($Row['vpn'] == 1)
    81         //{
    82           //exec('/sbin/iptables -t nat -A Block -m mac --mac-source '.$Row['MAC']." -j Local");
     81  //{
     82    //exec('/sbin/iptables -t nat -A Block -m mac --mac-source '.$Row['MAC']." -j Local");
    8383        //} else if($Row['vpn'] == 2) exec('/sbin/iptables -t nat -A Block -m mac --mac-source '.$Row['MAC']." -j Proxy");
    8484      }
Note: See TracChangeset for help on using the changeset viewer.