any sugestions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Im using this in a webserver that must redirect everything to
192.168.0.2 in port 25... any suggestions? using this script will enable
to accept connections in port 80 and forward all the port 25 to the
other server?? am I missing something or could it be improved?? 

echo 0 > /proc/sys/net/ipv4/ip_forward
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -i eth1 -d 192.168.0.2 -p tcp --dport 25 -j ACCEPT
iptables -t nat -A PREROUTING -i eth0 -d 192.168.0.1 -p tcp --dport 25
-j DNAT --to-destination 192.168.0.2:25
echo 1 > /proc/sys/net/ipv4/ip_forward

Thanx a lot 


-- 
Juan Hernandez
>Slacker til' death do us apart
If it seems slow it's just because there are too many things loaded...
and of course, it's not slack




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux