I have a quick script that takes web traffic on one internal ip, and
redirects it to another internal ip.  This is working fine in iptables. 
Can anyone show me how to recreate this in ipfw?



<?php


$eth     ="eth0:38";
$int_ip  ="192.168.1.238";
$int_port="80";
$ext_ip  ="10.0.0.238";
$ext_port="80";



echo("Flushing NAT Tables\n");
//exec("/sbin/iptables -F");
//exec("/sbin/iptables -t nat -F");

echo("Setting up PREROUTING.--------\n");
exec("/sbin/iptables -t nat -A PREROUTING -p tcp -i $eth -d $int_ip "
   . "--dport $int_port -j DNAT --to $ext_ip:$ext_port");

echo("Setting up POSTROUTING.-------\n");
exec("/sbin/iptables -t nat -A POSTROUTING -o $eth -j MASQUERADE");

echo("Setting up FORWARD.-----------\n");
exec("/sbin/iptables -A FORWARD -p tcp -i $eth -d $ext_ip "
   . "--dport $ext_port -j ACCEPT");

echo("\n\n");
echo `/sbin/iptables -t nat -L`;


?>

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to