URN Logo
UNIX Resources » Linux » China Linux Forum » Linux防火墙和代理服务器应用 » 3 » 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜托个位)
announcement 声明: 本页内容为中国Linux论坛的内容镜像,文章的版权以及其他所有的相关权利属于中国Linux论坛和相应文章的作者,如果转载,请注明文章来源及相关版权信息。
Resources
China Linux Forum(finished)
Linux Forum(finished)
FreeBSD China(finished)
linuxforum.net
  业界新闻与评论
  自由软件杂谈
  IT 人生
  Linux软件快递
  翻译作坊
  Linux图书与评论
  GNU Emacs/XEmacs
  Linux 中文环境和中文化
  Linux桌面与办公软件
  Linux 多媒体与娱乐版
  自由之窗Mozilla
  笔记本电脑上的Linux
  Gentoo
  Debian 一族
  网络管理技术
  Linux 安装与入门
  WEB服务器和FTP服务器
  域名服务器和邮件服务器
  Linux防火墙和代理服务器应用
  文件及打印服务器
  技术培训与认证
  Linux内核技术
  Linux 嵌入技术
  Linux设备驱动程序
  Linux 集群技术
  LINUX平台数据库
  系统和网络安全
  CPU 与 编译器
  系统计算研究所专栏
  Linux下的GUI软件开发
  C/C++编程版
  PHP 技 术
  Java&jsp技术
  Shell编程技术
  Perl 编 程
  Python 编 程
  XML/Web Service 技术
  永远的Unix
  FreeBSD世界
   
跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜托个位)
 
 
 
 
 
 
Subject: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜托个位)
Author: opkxfg    Posted: 2006-04-09 23:33    Length: 609 byte(s)
[Original] [Print] [Top]
最近我的老板发疯了 要我做 透明代理 我想是想逼我走 ,但我就是硬要做给他看
~~~ 所以 就靠个位大哥哥了 ~~~
我有redhat linux 9.0 的.iso 镜象 我会从硬盘安装它 ,我还有2块网卡 , 是8139的破网卡(老板不投资啊)!
我的目的是给 一个有 330台客户机的内网 做个透明代理 让他连上外网 可以做一切想做的事情!(以前是用的路由,可老板听人说路由不如 linux 透明

代理好.......)
 我对linux 认识很是疏浅~所以就靠个位大哥 多多赐教啦 ~本人是一万个感激~!本人
信箱  nihanbaoweifang@163.com QQ 12520065  我一定要争回这口气 让老板刮目相看~!

[Original] [Print] [Top]
Subject: Re: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜
Author: NetSnake    Posted: 2006-04-10 11:44    Length: 120 byte(s)
[Original] [Print] [Top]
这里和网上都有很多类似的安装、配置文档,你自己找来学着配配就行了,不是很复杂的工作。
任何事情最终都是靠自己的。
----
学习 ...
[Original] [Print] [Top]
Subject: Re: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜
Author: sender    Posted: 2006-04-13 14:41    Length: 4,425 byte(s)
[Original] [Print] [Top]
下面这个script,在启动系统后运行便可。当然,你必须运行iptables和squid。


#!/bin/bash
#Interface name which connect to the Internet

UPLINK="ppp0"

#if this is a router set ROUTER="yes" otherwise ROUTER="no"

ROUTER="yes"

#if need Squid, set SQUID="yes"
SQUID="yes"

#define intranet here

INTRASEG="192.168.1.0/24"

#change this next line to the static IP of your uplink interface for static SNAT, or
#"dynamic" if you have a dynamic IP. If you don't need any NAT, set NAT to "" to
#disable it.

NAT="dynamic"

#change this next line so it lists all your network interfaces, including lo

INTERFACES="lo eth0 eth1 eth2 eth3 ppp0"

#change this line so that it lists the assigned numbers or symbolic names (from
#/etc/services) of all the services that you'd like to provide to the general
#public. If you don't want any services enabled, set it to ""
#SERVICES="http ftp smtp ssh rsync"

SERVICES=""

if [ "$1" = "start" ]
then
echo "Starting firewall..."

#Refresh all chains
iptables -F -t nat

#set INPUT chain's policy to DROP, means packets which do not match any of
#our rules will be dropped at last.
iptables -P INPUT DROP

# allow intranet access
iptables -A INPUT -i ! ${UPLINK} -j ACCEPT

# allow relate connections from internet
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

#enable public access to certain services
for x in ${SERVICES}
do
iptables -A INPUT -p tcp --dport ${x} -m state --state NEW -j ACCEPT
done

#other packets coming from UPLINK interface will be REJECT
iptables -A INPUT -p tcp -i ${UPLINK} -j REJECT --reject-with tcp-reset
iptables -A INPUT -p udp -i ${UPLINK} -j REJECT --reject-with icmp-port-unreachable

#explicitly disable ECN

if [ -e /proc/sys/net/ipv4/tcp_ecn ]
then
echo 0 > /proc/sys/net/ipv4/tcp_ecn
fi

#disable spoofing on all interfaces
for x in ${INTERFACES}
do
echo 1 > /proc/sys/net/ipv4/conf/${x}/rp_filter
done

if [ "$ROUTER" = "yes" ]
then
#we're a router of some kind, enable IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -P FORWARD ACCEPT

#enable transparent Squid proxy
if [ "$SQUID" = "yes" ]
then

echo "Enabling transparent Squid internet proxy..."
iptables -t nat -A PREROUTING -i ${SQUID} -p tcp -m tcp -d ! ${INTRASEG}
--dport 80 -j REDIRECT --to-ports 3128

fi


if [ "$NAT" = "dynamic" ]
then

#dynamic IP address, use masquerading
echo "Enabling masquerading (dynamic ip)..."
iptables -t nat -A POSTROUTING -s ${INTRASEG} -d ! ${INTRASEG} -o ${UPLINK} -j
MASQUERADE

elif [ "$NAT" != "" ]
then

#static IP, use SNAT
echo "Enabling SNAT (static ip)..."
iptables -t nat -A POSTROUTING -o ${UPLINK} -j SNAT --to ${UPIP}

fi

fi
elif [ "$1" = "stop" ]
then

echo "Stopping firewall..."
iptables -F INPUT
iptables -P INPUT ACCEPT

#turn off NAT/masquerading, if any
iptables -t nat -F
fi
----
To be or not to be, that's a question.
[Original] [Print] [Top]
Subject: Re: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜
Author: albtross    Posted: 2006-04-18 22:43    Length: 95 byte(s)
[Original] [Print] [Top]
我建议你使用现场的软路由,moothwall 和 routerOS 都含有透明代理功能,资料可以到中国路由网去查找。
[Original] [Print] [Top]
Subject: Re: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜托个位)
Author: dfl2323    Posted: 2006-04-21 11:03    Length: 260 byte(s)
[Original] [Print] [Top]
330台客户机的内网用两个破8139的网卡?????????!!!!!!!

我这里只有150多台机子,外网我用的是8139(ETH0),内网用的是D——LINK(ETH1)的,但是系统老是提示ETH1:TOO MUCH WORK AT INTERRUPTE。

看来的网卡是不够用了。
----
寒冷时,有关自己的左手来温暖自己的右手!!!
[Original] [Print] [Top]
Subject: Re: 跪求~redhat linux9.0 做 squid 透明代理 全过程~(关系到本人前程,拜托个位)
Author: crts    Posted: 2006-05-08 12:17    Length: 149 byte(s)
[Original] [Print] [Top]
8139的破网卡!!!!

那是个人用的,有几十个用户的话,早暴掉了

如果老板一定要你用这卡,你还是辞职吧,你不可能做好的
[Original] [Print] [Top]
« Previous thread
救命啊~~!帮帮我 我的 REDHAT 9.0 SQUID 启动不了啊 ~
Linux防火墙和代理服务器应用
3
Next thread »
rrdw 如何打开防火墙?
     

Copyright © 2007 UNIX Resources Network, All Rights Reserved.      About URN | Privacy & Legal | Help | Contact us
备案序号: 京ICP备05006143    webmaster: webmaster@unixresources.net
This page created on 2008-07-17 02:58:38, cost 0.074397087097168 ms.