• Kerjaan Thu, Apr 29, 2010

    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

    Posted by roman @ 3:28 pm for Kerjaan |

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

April 2010
M T W T F S S
« Feb   Jun »
 1234
567891011
12131415161718
19202122232425
2627282930  

Chat here