LinuxSir.cn,穿越时空的Linuxsir!

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

iptables + squid + 认证在 linux & Mac os 中不起作用

[复制链接]
发表于 2005-2-1 00:43:09 | 显示全部楼层 |阅读模式
用 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
发表于 2005-2-1 12:41:11 | 显示全部楼层
是否记忆了MAC地址,直接通过认证~

没开SQUID的认证,没注意~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-1 13:59:13 | 显示全部楼层
是同一台电脑,在 win2000 下需要认证, MDK10 下就直接上网了。才发现有问题。
再去 Apple 上试了下, 也是没经过认证就可以上网。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-1 15:48:16 | 显示全部楼层
是不是 NCSA 的认证程序只能在 win 下运行? 有没有相关的资料啊?
回复 支持 反对

使用道具 举报

发表于 2005-2-1 19:18:12 | 显示全部楼层
看看其他兄弟能否帮忙~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-5 14:48:00 | 显示全部楼层


-------正在研究 PAM_AUTH。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-6 15:42:53 | 显示全部楼层
是 firewall 的错。
NCSA 可以支持 linux 。
Mac 节后再试 。
回复 支持 反对

使用道具 举报

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

本版积分规则

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