安装记录:
debian 做代理服务器, WINXP共享上网 .
电信ADSL (PPPOE) , 4口HUB
WINXP IP设置:
IP :192.168.0.5
网关:192.168.0.1
debian :#cat /etc/network/interfaces
- # This file describes the network interfaces available on your system
- # and how to activate them. For more information, see interfaces(5).
- # The loopback network interface
- auto lo
- iface lo inet loopback
- # The primary network interface
- #auto eth0
- iface eth0 inet static
- name debian
- address 192.168.0.1
- netmask 255.255.255.0
- network 192.168.0.1
- broadcast 192.168.101.255
- gateway 192.168.0.1
- # dns-* options are implemented by the resolvconf package, if installed
- dns-nameservers 192.168.0.1
- auto dsl-provider
- iface dsl-provider inet ppp
- provider dsl-provider
- # please do not modify the following line
- pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
复制代码
S1 :
apt-get install squid
apt-get install ipstables
S2:
修改/etc/squid/squid.conf
- http_port 3128
- visible_hostname debian
- cache_dir ufs /var/spool/squid 500 16 256
- cache_mem 20 MB
- cache_swap_low 90
- cache_swap_high 95
- httpd_accel_host virtual
- httpd_accel_port 80
- httpd_accel_with_proxy on
- httpd_accel_uses_host_header on
- acl all src 0.0.0.0/0.0.0.0
- http_access allow all
复制代码
S3:
#squid -z
# /etc/init.d/squid restart
s4:
加载ipstables模块:
- modprobe ip_tables
- modprobe ip_nat_ftp
- modprobe ip_conntrack
- modprobe ip_conntrack_ftp
复制代码
S5:
- #echo 1 > /proc/sys/net/ipv4/ip_forward
- #iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
- #iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
复制代码
完成 !
iptables 不是很熟悉 ,研究ying ... |