Written by Bima Firewall
Posted in:
Ubuntu
Share
Aktifkan ip forward :
#echo 1 > /proc/sys/net/ipv4/ip_forward
Masquerade IP, untuk masquerade IP client menjadi IP Public sehingga bisa meresolv domain :
iptables -t nat -A POSTROUTING -j MASQUERADE
Redirect port 80 ke port Squid 3128 :
iptables -t nat -A PREROUTING -s 192.168.0.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.10.10:3128
iptables -A PREROUTING -t nat -j REDIRECT -p tcp -s 192.168.0.0/24 -d 0/0 –dport 80 –to-ports 3128
iptables –t nat –A PREROUTING –p tcp –s 192.168.0.0/24 – -dport 80 –j REDIRECT – -to-port 3128
sudo iptables -A PREROUTING -t nat -p tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -A PREROUTING -t nat -j REDIRECT -p tcp -s 192.168.0.0/24 -d 0/0 --dport 80 --to-ports 3128
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3128
di sesuaikan dengan kemauan agan ya...
Manual :
di copy ke etc/rc.local
tempatkan di paling bawah.... Ok
0 comments:
Post a Comment