|
Step one > Create a file rc.nat in /etc/rc.d/ then put the follwing code
iptables=/sbin/iptables
iptables --flush -t nat
iptables --table nat --append POSTROUTING --out-interface ppp0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
now make it excutable by the command
chmod 755 /etc/rc.d/rc.nat
Now u add the following lines in your /etc/rc.d/rc.local file, so that every time u start yourcomputer it get executed automatically.
|