LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1239|回复: 1

debian做代理服务器,WINXP共享上网

[复制链接]
发表于 2006-2-13 15:03:14 | 显示全部楼层 |阅读模式
安装记录:

debian 做代理服务器, WINXP共享上网 .

电信ADSL (PPPOE) , 4口HUB

WINXP IP设置:

    IP :192.168.0.5
    网关:192.168.0.1

debian :#cat /etc/network/interfaces
        
   

  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # The primary network interface
  7. #auto eth0
  8. iface eth0 inet static
  9.         name debian
  10.         address 192.168.0.1
  11.         netmask 255.255.255.0
  12.         network 192.168.0.1
  13.         broadcast 192.168.101.255
  14.         gateway 192.168.0.1
  15.         # dns-* options are implemented by the resolvconf package, if installed
  16.         dns-nameservers 192.168.0.1

  17. auto dsl-provider
  18. iface dsl-provider inet ppp
  19.      provider dsl-provider
  20. # please do not modify the following line
  21.      pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf   
复制代码



S1 :
     apt-get install squid
     apt-get install ipstables

S2:
    修改/etc/squid/squid.conf
   

  1.      http_port 3128
  2.      visible_hostname debian
  3.      cache_dir ufs /var/spool/squid 500 16 256
  4.      cache_mem 20 MB
  5.      cache_swap_low 90
  6.      cache_swap_high 95
  7.      httpd_accel_host virtual
  8.      httpd_accel_port 80
  9.      httpd_accel_with_proxy on
  10.      httpd_accel_uses_host_header on
  11.      acl all src 0.0.0.0/0.0.0.0
  12.      http_access allow all  
复制代码


S3:
      #squid -z
      # /etc/init.d/squid restart

s4:
      加载ipstables模块:
     

  1.         modprobe ip_tables
  2.         modprobe ip_nat_ftp
  3.         modprobe ip_conntrack
  4.         modprobe ip_conntrack_ftp
复制代码


S5:
     

  1.       #echo 1 > /proc/sys/net/ipv4/ip_forward
  2.       #iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
  3.       #iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
复制代码



完成  !

     iptables 不是很熟悉   ,研究ying ...
发表于 2006-2-13 15:36:44 | 显示全部楼层
你这是单网卡啊
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表