免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3668 | 回复: 4
打印 上一主题 下一主题

[proxy] 代理服务器周期性掉线! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-31 06:31 |只看该作者 |倒序浏览
本局域网内代理服务器为192.168.0.1,OS:CentOS3.8,NAT+SQUID透明代理上网。
一直以来都很正常使用,春节我请假回家期间,大概有28天未关机都能正常使用。
但最近半个月来老是周期性掉线,已经测试过了,电信局方面没出现问题,特别是在晚上12点之后,掉线得特别厉害,白天基本上不出问题,但这两天偶尔也出问题了。客户机ping某某IP,也比较稳定,但就是间隔大概半个小时就得掉线了,timeout大概20秒之后又恢复正常。
请帮我分析一下原因和补救的方法。谢谢。

附fire.sh

/sbin/modprobe ip_tables
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_conntrack_ftp
iptables -F
iptables -X
iptables -F -t mangle
iptables -t mangle -X
iptables -F -t nat
iptables -t nat -X

echo"1">/proc/sys/net/ipv4/ip_forward
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT


iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to xxx.xxx.xxx.xxx

iptables -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3128
iptables -A PREROUTING -s 192.168.0.0/24 -i eth1 -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 3128

iptables -A INPUT -p icmp --icmp-type 8 -s 0/0 -j DROP
iptables -A INPUT -p icmp --icmp-type 0 -s 0/0 -j ACCEPT

iptables -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT

iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT

iptables -A FORWARD -p icmp -m limit --limit 1/s --limit-burst 10 -j ACCEPT


iptables -t filter -A INPUT -p icmp -m icmp --icmp-type 8 -m limit --limit 6/minute --limit-burst 2 -j ACCEPT
iptables -t filter -A INPUT -p icmp -m icmp --icmp-type 8 -j REJECT --reject-with icmp-port-unreachable

iptables -A FORWARD -p tcp --dport 4444 -j DROP
iptables -A FORWARD -p udp --dport 4444 -j DROP

iptables -A FORWARD -p tcp --dport 445 -j DROP
iptables -A FORWARD -p udp --dport 445 -j DROP

iptables -A FORWARD -p tcp --dport 69 -j DROP
iptables -A FORWARD -p udp --dport 69 -j DROP

iptables -A FORWARD -p tcp --dport 135 -j DROP
iptables -A FORWARD -p udp --dport 135 -j DROP

iptables -A FORWARD -p tcp --dport 139 -j DROP
iptables -A FORWARD -p udp --dport 139 -j DROP
iptables -A INPUT -d 192.168.0.0/255.255.0.0 -i eth0 -j DROP
iptables -A INPUT -s 192.168.0.0/255.255.0.0 -i eth0 -j DROP

iptables -A OUTPUT -d 192.168.0.0/255.255.0.0 -o eth0 -j DROP
iptables -A OUTPUT -s 192.168.0.0/255.255.0.0 -o eth0 -j DROP

iptables -A INPUT -s 255.255.255.255 -i eth1 -j DROP
iptables -A INPUT -s 224.0.0.0/224.0.0.0 -i eth1 -j DROP
iptables -A INPUT -d 0.0.0.0 -i eth1 -j DROP


squid.conf:


http_port 3128
cache_mgr shinyrose@126.com
cache_mem 128 MB
dns_nameservers 202.96.128.68 61.144.56.101 61.144.56.100
cache_dir ufs /var/spool/squid 6000 12 256
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
error_directory /usr/share/squid/errors/Simplify_Chinese
visible_hostname proxy
cache_effective_user squid
cache_effective_group squid
acl SSL_ports port 443 563
acl Safe_ports port 80
acl Safe_ports port 443 563
cache_swap_low 85
cache_swap_high 90
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl our_clients src 192.168.0.0/255.255.255.0
acl other_clients src 0.0.0.0/0.0.0.0
http_access allow our_clients
http_access deny other_clients

[ 本帖最后由 shinyrose 于 2007-3-31 06:32 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-03-31 06:31 |只看该作者
这几天为这个事情真是烦死了,觉都没睡好。一直以来都很正常使用的,去年9月份做的代理服务器,运行已经有大半年了,除了停电,基本上没关过机,也没出现过大问题。但现在真的没办法了。还是原来的机器,昨天重新做过系统,也照样出现掉线的问题。


按道理说晚上12点以后不是上网高峰。怎么就那个时候掉线特别严重呢?白天很少出现问题。
难道有人攻击?有一个晚上,出现掉线情况以后,把光纤只接一台windows机器,也不出现掉线问题。真分析不出来问题出现在哪了。

[ 本帖最后由 shinyrose 于 2007-3-31 06:36 编辑 ]

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
3 [报告]
发表于 2007-03-31 23:32 |只看该作者
掉线的时候,在服务器访问外部,有问题么

通过代理的话,代理此时的日志什么怎么说呢?

论坛徽章:
0
4 [报告]
发表于 2007-04-01 02:49 |只看该作者
Apr  1 00:34:03 myproxy kernel: conntrack_ftp: partial 227  3730074950+13
Apr  1 00:34:03 myproxy kernel: conntrack_ftp: partial 227  2119620471+13
Apr  1 00:34:03 myproxy kernel: conntrack_ftp: partial 227  2733167527+13
Apr  1 00:34:03 myproxy kernel: conntrack_ftp: partial 227  4173089841+13
Apr  1 00:42:20 myproxy kernel: conntrack_ftp: partial 227  3293251723+13
Apr  1 00:42:20 myproxy kernel: conntrack_ftp: partial 227  377581415+13
Apr  1 00:42:20 myproxy kernel: conntrack_ftp: partial 227  2586660702+13
Apr  1 01:00:31 myproxy kernel: conntrack_ftp: partial 227  433059838+13
Apr  1 01:00:31 myproxy kernel: conntrack_ftp: partial 227  1513194627+13
Apr  1 01:04:43 myproxy kernel: conntrack_ftp: partial 227  464450160+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  2622655590+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  2004578552+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  2713092443+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  594218338+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  2995902356+13
Apr  1 01:40:44 myproxy kernel: conntrack_ftp: partial 227  2458165069+13
Apr  1 01:49:08 myproxy kernel: eth1: link down
Apr  1 01:49:13 myproxy kernel: eth1: link up, 100Mbps, full-duplex, lpa 0x45E1
Apr  1 02:24:27 myproxy sshd(pam_unix)[3387]: session opened for user root by root(uid=0)
Apr  1 02:44:38 myproxy sshd(pam_unix)[3421]: check pass; user unknown
Apr  1 02:44:38 myproxy sshd(pam_unix)[3421]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12
Apr  1 02:44:42 myproxy sshd(pam_unix)[3424]: check pass; user unknown
Apr  1 02:44:42 myproxy sshd(pam_unix)[3424]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12
Apr  1 02:44:46 myproxy sshd(pam_unix)[3428]: check pass; user unknown
Apr  1 02:44:46 myproxy sshd(pam_unix)[3428]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12
Apr  1 02:44:50 myproxy sshd(pam_unix)[3430]: check pass; user unknown
Apr  1 02:44:50 myproxy sshd(pam_unix)[3430]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12
Apr  1 02:44:53 myproxy sshd(pam_unix)[3432]: check pass; user unknown
Apr  1 02:44:53 myproxy sshd(pam_unix)[3432]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12
Apr  1 02:44:57 myproxy sshd(pam_unix)[3434]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12  user=root
Apr  1 02:45:01 myproxy sshd(pam_unix)[3436]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12  user=root
Apr  1 02:45:05 myproxy sshd(pam_unix)[3439]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12  user=root
Apr  1 02:45:09 myproxy sshd(pam_unix)[3442]: check pass; user unknown
Apr  1 02:45:09 myproxy sshd(pam_unix)[3442]: authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=222.255.236.12

论坛徽章:
0
5 [报告]
发表于 2007-04-01 02:53 |只看该作者
上面的是关闭squid,只用NAT之后的部分log,怎么出现不明IP?222.255.236.12
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP