Find the answer to your Linux question:
Results 1 to 2 of 2
Hello all, this is actually my first post, so here it goes i want my desktop pc to act as a proxy server for the rest of my lan network, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    1

    proxy server


    Hello all, this is actually my first post, so here it goes

    i want my desktop pc to act as a proxy server for the rest of my lan network, in other way to share my internet connection
    it goes something like this:

    DSL router --> Desktop PC --> lan network

    the desktop pc connects to the dsl router only by wireless (wlan0) and to the rest of the
    lan network with a wired card (eth0)
    the wifi is using the ndiswrapper driver
    here is the script i tried:

    #!/bin/sh
    iwconfig essid "blahblah"
    iwconfig key s:blahblahblah
    ifconfig wlan0 up
    dhclient3 wlan0
    ifconfig eth0 up
    ifconfig eth0 192.168.0.1
    INTIF="eth0"
    EXTIF="wlan0"
    EXTIP="`/sbin/ifconfig wlan0 | 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 ACCEPT
    iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
    iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

    one more weird thing is that when i'm connected to the internet (with the wlan0 interface) and i'm giving to eth0 the ip 192.168.0.1 i cannot ping anything from internet, e.g Google but i can still ping the dsl router.

    any help will be grateful. thenx :>

  2. #2
    Just Joined! ManishSinha's Avatar
    Join Date
    Dec 2007
    Location
    Manipal,India
    Posts
    28
    You can use squid as proxy server as we use it.

    Did I say correcty, or I missed your requirements?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •