|
|
用 linux 双网卡做了一个代理服务器,目标是:
1,内网中部分电脑可以直接上网,不受限制。
2,其它电脑需要输入用户名 + 密码才能上网。
软件版本:
linux : 2.6.8.1
iptables : 1.2.11
squid : 2.5STANLE7
现在的问题是:windows 系列的电脑(98、2000、xp)上网时都会有一个认证窗口跳出来,要输入密码后才能上网,而 linux 、 Apple 的电脑则直接就上网了,就好象没有认证程序一样。
下面是配置文件,请帮忙看一下有没有解决的办法:
1:/etc/rc.d/firewall
#!/bin/bash
EXT_IP=192.168.0.1
EXT_IF=ppp0
INT_IF=eth1
ALLOWED_ICMP="0 3 3/4 4 11 12 14 16 18"
DENIED_ICMP="8"
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -F -t filter
iptables -X -t filter
iptables -Z -t filter
iptables -F -t natiptables -X -t nat
iptables -Z -t nat
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -N block
iptables -A block -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A block -m state --state NEW,INVALID -i $EXT_IF -j DROP
iptables -A block -m state --state NEW -i ! $EXT_IF -j ACCEPT
iptables -A block -j DROP
iptables -A INPUT -j icmpfilter
iptables -A INPUT -j block
iptables -A FORWARD -j icmpfilter
iptables -A FORWARD -j block
iptables -t nat -A POSTROUTING -o $EXT_IF -j MASQUERADE
iptables -t nat -A PREROUTING -d $INT_IP -i $INT_IF \
-p tcp -m tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -i $INT_IF -p tcp -m tcp \
--dport 80 -j REDIRECT --to-ports 3128
iptables -t nat -A PREROUTING -p tcp -m multiport --dport 25 110 -j ACCEPT
2: /etc/squid/squid.conf
visible_hostname proxy
# Socket address where squid will listen
http_port 192.168.0.1:3128
cache_mgr admini
cache_effective_user squid
cache_effective_group squid
cache_dir ufs /var/squid 512 16 256
cache_mem 256 MBcache_swap_low 90
cache_swap_high 95
client_netmask 255.255.255.255
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
icon_directory /usr/share/squid/icons
error_directory /usr/share/squid/errors
pid_filename /var/run/squid.pid
# access lists
acl localhost src 127.0.0.1/255.255.255.255
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
#acl Safe_ports port 25 110 465 995 143 993
acl CONNECT method CONNECT
acl advance arp 00:00:00:00:00:00
auth_param basic program /usr/bin/ncsa_auth /usr/etc/password
auth_param basic children 5
auth_param basic realm My Proxy Caching Domain
auth_param basic credentialsttl 2 hours
acl normal proxy_auth REQUIRED
acl all src 0.0.0.0/0.0.0.0
http_access allow advance
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow normal
http_access deny all
# End of file |
|