Ini merupakan rangkuman iptables yang saya gunakan untuk konfigurasi centos sebagai proxy. Merupakan dokumentasi online saya :) .

Perintah untuk flush isi iptables :

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT

Perintah untuk menyalakan fungsi NAT MASQUERADE :

# service iptables stop
# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE   // eth1 terhubung ke internet
# service iptables save
# service iptables restart

Perintah untuk redirect packet dari LAN ke port squid 3128 :

iptables -t nat -A PREROUTING -i eth1 -p tcp –dport 80 -j DNAT –to 192.168.1.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 3128

catatan : eth1 terhubung ke LAN dan eth0 terhubung ke internet , 192.168.1.1 = ip proxy server

Category: Kerjaan
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Leave a Reply » Log in