<?php
require_once "config.php";

global $DB;
$data_t = $DB->selectPage($totalCount,"SELECT * FROM iface WHERE type='out' ORDER BY id");
foreach($data_t as $data_k=>$data_v)
{
	if($data_v[nat_ip]!='')
	{
		echo "/sbin/ipfw -q add ".($data_v[id]+1000)." divert ".($data_v[id]+8888)." all from ".$data_v[nat_ip]." to any \n";
		echo "/sbin/ipfw -q add ".($data_v[id]+1200)." fwd ".$data_v[ip_route]." ip from ".$data_v[ip]." to any \n";
		echo "/sbin/ipfw -q add ".($data_v[id]+1400)." divert ".($data_v[id]+8888)." all from any to ".$data_v[ip]." via ".$data_v[name]." \n";
		echo "/sbin/ipfw -q add ".($data_v[id]+1600)." allow all from any to any via ".$data_v[name]." \n";
	}
}
?>
