Changeset 118 for system/generators/iptables.php
- Timestamp:
- Dec 3, 2008, 11:36:51 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/generators/iptables.php
r116 r118 38 38 { 39 39 //echo($User['fullname']."\n"); 40 $DbResult2 = $Database->select('hosts', '*','block<2 AND MAC!="" AND user='.$User['id'].'ORDER BY id DESC');40 $DbResult2 = $Database->select('hosts', '*', '(block < 2) AND (MAC != "") AND (user='.$User['id'].') AND (IP != external_ip) ORDER BY id DESC'); 41 41 while($Row = $DbResult2->fetch_array()) 42 42 { … … 56 56 // exec('/sbin/iptables -t nat -A POSTROUTING -m tcp -p tcp -s '.$Row['IP'].' --sport 3725 -o eth1 -j SNAT --to-source '.$Row['external_ip'].':3724'); 57 57 //} 58 if(strtolower($Row['name']) != ' centrala')58 if(strtolower($Row['name']) != 'gate') 59 59 { 60 60 if($Row['external_ip'] != '') … … 96 96 97 97 // SMTP NAT port 25 98 $DbResult = $Database->select('hosts', '*', 'name="mail"');99 $Row = $DbResult->fetch_array();100 exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d 212.111.4.174 -j DROP');101 exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d '.$Row['external_ip'].' -j DNAT --to-destination '.$Row['IP']);102 exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d '.$Row['external_ip'].' -j ACCEPT');103 exec('/sbin/iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 25 -s 212.111.4.174 -o eth1 -j SNAT --to-source '.$Row['external_ip']);98 //$DbResult = $Database->select('hosts', '*', 'name="mail"'); 99 //$Row = $DbResult->fetch_array(); 100 //exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d 212.111.4.174 -j DROP'); 101 //exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d '.$Row['external_ip'].' -j DNAT --to-destination '.$Row['IP']); 102 //exec('/sbin/iptables -t nat -A PreroutingDNAT -p tcp -m tcp --dport 25 -d '.$Row['external_ip'].' -j ACCEPT'); 103 //exec('/sbin/iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 25 -s 212.111.4.174 -o eth1 -j SNAT --to-source '.$Row['external_ip']); 104 104 105 105 // Local network NAT
Note:
See TracChangeset
for help on using the changeset viewer.