Problem setting up a Debian Web proxy.

Discussion in 'HOWTO-Related Questions' started by tritsako, Jun 22, 2009.

  1. tritsako

    tritsako New Member

    Hi to all,

    I have created a Webproxy server with debian using squid and the below script:


    #!/bin/sh
    INTIF="eth0"
    EXTIF="eth2"
    #EXTIP="`/sbin/ifconfig eth2 | grep 'inet addr' | awk '{print $2}' | sed -e 's/$
    /sbin/depmod -a
    /sbin/modprobe ip_tables
    /sbin/modprobe ip_conntrack
    /sbin/modprobe ip_conntrack_ftp
    /sbin/modprobe ip_conntrack_irc
    /sbin/modprobe iptable_nat
    /sbin/modprobe ip_nat_ftp
    echo "1" > /proc/sys/net/ipv4/ip_forward
    echo "1" > /proc/sys/net/ipv4/ip_dynaddr
    iptables -P INPUT ACCEPT
    iptables -F INPUT
    iptables -P OUTPUT ACCEPT
    iptables -F OUTPUT
    iptables -P FORWARD DROP
    iptables -F FORWARD
    iptables -t nat -F
    iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j$
    iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
    iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE



    The web proxy is working fine, although as the same system is working as a Web Server also, the above script (as it starts the firewall) do not let the requests outside of my local network to go to the web server and they are stopped so the web proxy too.

    How can I let all packet requests go in the web server?

    Thank you in advance.
    Costas.
     

Share This Page