From: Alper Oguz (alperliste@showtv.com.tr)
Date: Tue 15 Jul 2003 - 16:13:32 EEST
Merhaba,
Cevaplar icin cok tesekkurler. Php'yi biraz daha bildigimden
Enver Altin'in soyledigi gibi php'de yaptim. Asagidaki calisiyor.
sevgiler
-------------------------
#!/usr/bin/php -q
<?
$LANIP = "1.2.3.4";
$dosya = fopen("/etc/squid/yonlendirme","r");
while (!feof($dosya))
{
$makine = fgets($dosya,25);
$makine = trim($makine);
exec("iptables -t nat -A PREROUTING -p tcp -s $makine -d 0/0 --dport 80 -j DNAT --to $LANIP:8080");
}
fclose($dosya);
?>
-- Alper Ošuz alperliste@showtv.com.tr