免费注册 查看新帖 |

Chinaunix

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

[FreeBSD] freeBSD下有没有类似Sygate这样的网关型代理服务器软件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-02-14 12:44 |只看该作者 |倒序浏览
单位里打算用一台BSD的服务器做网关,以前用的是w2k+Sygate,之所以现在想用bsd是为了方便把一些现成的程序放在上面,并且便于远程管理。但是不知道freeBSD下有没有类似Sygate这样的网关型代理服务器软件,请各位属性bsd的推荐几个,谢谢!

补充说明:Sygate是一个网关型代理服务器软件,它运行在Windows平台上,支持所有的Internet应用和协议:HTTP、FTP、POP3、SMTP等

作为一个网关型代理服务器,具有站点访问控制、指定允许和过滤IP、DHCP动态IP分配、记录日志、防火墙安全保护等功能

http://www0.ccidnet.com/school/software//2001/09/14/70_5126.html

论坛徽章:
1
寅虎
日期:2013-09-29 23:15:15
2 [报告]
发表于 2006-02-14 13:36 |只看该作者
PF/IPF/IPFW??

论坛徽章:
0
3 [报告]
发表于 2006-02-14 13:55 |只看该作者

^

使用pf + squid 应该可以满足你的要求吧?
DHCP你直接启DHCPD的服务就可以了。

论坛徽章:
0
4 [报告]
发表于 2006-02-14 15:03 |只看该作者
谢谢,PF是什么啊?ipfw不是防火墙吗?
使用squid需要改动每个ie的设置吗?这样会比较麻烦,共享上网的用户很多的

[ 本帖最后由 白水 于 2006-2-14 15:10 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-02-14 15:16 |只看该作者
原帖由 Eg_zm 于 2006-2-14 13:55 发表
使用pf + squid 应该可以满足你的要求吧?
DHCP你直接启DHCPD的服务就可以了。



人家已经提醒你了,还不知足?不要老想着别人嚼烂了再喂你呀……

论坛徽章:
0
6 [报告]
发表于 2006-02-14 15:30 |只看该作者
在freebsd下面其实也有很多代理服务器
如同windows下有sygate也有winroute一样
但是现在用的比较多的基本上就是squid这样的代理服务
同样也支持很多的协议但是不支持ftp协议
但是我们可以配合楼上说的pf来完成
pf除了能完成共享外还可以进行端口的映象等

总的来说squid+pf基本上能满足一般的单位的运用了

你说的这些功能中
站点访问控制(squid能很好的完成)
指定允许和过滤IP(可以用pf的规则来限制)
记录日志(squid和pf都有这个功能,但是记录的类型不一样)
防火墙安全保护(这个是pf的强项哦)

这个是我做的笔记http://bbs.chinaunix.net/viewthread.php?tid=678173&highlight=
你可以参考下

论坛徽章:
0
7 [报告]
发表于 2006-02-14 15:38 |只看该作者
非常感谢大家!我是个菜鸟,最近忽然接手这个事情,还没有头绪呢,我仔细研究一下先,呵呵。

论坛徽章:
0
8 [报告]
发表于 2006-02-14 23:30 |只看该作者
原帖由 盛世唐朝 于 2006-2-14 15:30 发表
在freebsd下面其实也有很多代理服务器
如同windows下有sygate也有winroute一样
但是现在用的比较多的基本上就是squid这样的代理服务
同样也支持很多的协议但是不支持ftp协议
但是我们可以配合楼上说的pf来完成 ...


还有点问题,您那个链接里写的是反向代理?我是需要通过在一个服务器上装类似sygate这样功能的软件,让单位里的若干台电脑共享ADSL上网,也可以吗?

论坛徽章:
0
9 [报告]
发表于 2006-02-15 08:16 |只看该作者
squid主要的功能就是完成代理
反向代理也是其中的一个功能

squid+pf能完成sygate这样的功能

论坛徽章:
0
10 [报告]
发表于 2006-02-15 08:24 |只看该作者
这个是我以前作的一个squid+ipfilter的笔记
你先看看其实ipfilter基本上和pf差不了多少

代理服务器编译文档
1、安装freebsd系统
1        最小化安装,2        安装的时候加入内核sys的选项
3        安装完成后配置网卡
需要修改的内容如下
配置网卡
ifconfig_fxp0="inet 192.168.1.1 netmask 255.255.255.0"
ifconfig_fxp1="inet 218.4.84.219 netmask 255.255.255.248"
hostname="gateway.wgczx.com"
defaultrouter="218.4.84.217"
sendmail_enable="NONE"
usb_enable="NO"
配置resolv.conf文件
domain  wgczx.com
nameserver      61.177.7.1
freebsd4.7系统安装完毕
2、编译freebsd内核使NAT成为可能
cd /usr/src/sys/i386/conf
cp GENERIC gateway
加上
options        IPFILTER
options        IPFILTER_LOG
options        RANDOM_IP_ID
options        BRIDGE
options        IPFILTER_DEFAULT_BLOCK
/usr/sbin/config gateway
cd        ../../compile/ gateway
make depend
make
make install
reboot
重新启动
编辑/etc/rc.conf
加入以下内容
gateway_enable="YES"
ipfilter_enable="YES"
ipf –C –f /etc/ipf.rules
ipfilter_program="/sbin/ipf"
ipfilter_rules="/etc/ipf.rules"
ipfilter_flags=""
ipnat_enable="YES"
ipnat_program="/sbin/ipnat"
ipnat_rules="/etc/ipnat.rules"
ipnat_flags="CF"
ipmon_enable="YES"
ipmon_program="/sbin/ipmon"
ipmon_flags="-D /var/log/ipfilter.log"
在/var/log/建立文件ipfilter.log,并更改其属性为755
touch /var/log/ipfilter.log
chmod 755 /var/log/ipfilter.log
这样你的防火墙日志就记录到/var/log/ipfilter.log文件中,可以随时对其进行查看。
在/etc/建立ipnat.rules文件
ee /etc/ipnat.rules
map fxp1 192.168.1.0/24 -> 218.4.84.221/32 proxy port ftp ftp/tcp
map fxp1 192.168.1.0/24 -> 218.4.84.221/32 portmap tcp/udp 10000:30000
map fxp1 192.168.1.0/24 -> 218.4.84.221/32
rdr fxp0 0.0.0.0/0 port 80 -> 127.0.0.1 port 3128 tcp
在/etc/建立ipf.rules文件
ee /etc/ipf.rules
block in quick  on fxp0 proto tcp from 192.168.1.0/24 to any port = 2000
block in quick on fxp0 proto tcp from 192.168.1.0/24 to any port = 4000
block in quick on fxp0 proto tcp from 192.168.1.0/24 to any port = 8000
pass in all
pass out all
NAT设置完毕
squid编译
下载所需软件
解压
tar zxvf squid-2.5.STABLE6.tar.gz
cd squid-2.5.STABLE6
编译
./configure --prefix=/usr/local/squid  #指定Squid的安装位置
--enable-arp-acl
#这样可以在规则设置中直接通过客户端的MAC地址进行管理,防止客户使用IP欺骗。
--enable-pthreads
--enable-err-languages="Simplify_Chinese"
--enable-default-err-languages="Simplify_Chinese"
#上面两个选项告诉Squid编入并使用简体中文错误信息。
--enable-storeio=ufs,null
--enable-underscore
#允许解析的URL中出现下划线,因为默认情况下Squid会认为带下划线的URL是
非法的,并拒绝访问该地址。
--enable-ipf-transparent
Make   make install
安装完成后,接下来要对Squid的运行进行配置(不是前面安装时的配置)。所有项目都在squid.conf中完成。
Squid配置文件:
http_port 192.168.1.1:3128
cache_mgr beini@wgczx.com
cache_mem 50 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
cache_dir ufs /home/cache 3072 16 256
cache_access_log /usr/local/squid/var/logs/access.log
cache_log /usr/local/squid/var/logs/cache.log
cache_store_log /usr/local/squid/var/logs/store.log
cache_effective_user nobody
cache_effective_group nogroup
visible_hostname squid.wgczx.com
error_directory /usr/local/squid/share/errors/Simplify_Chinese
forwarded_for off

acl SSL_ports port 443 563
acl Safe_ports port 80 21 443 563 70 210 280 488 591 777
http_access deny !Safe_ports

acl all src 0.0.0.0/0.0.0.0
acl mornorm time MTWHF 0:01-6:59
acl evenorm time MTWHF 11:00-12:59
acl daynorm time MTWHF 16:01-17:59
acl nignorm time MTWHF 21:01-23:59
acl weekend time SA
http_access allow mornorm
http_access allow evenorm
http_access allow daynorm
http_access allow nignorm
http_access allow weekend
acl game dst "/usr/local/squid/etc/game"
http_access deny game
acl bad dstdomain "/usr/local/squid/etc/bad"
http_access deny bad
acl good dstdomain "/usr/local/squid/etc/good"
http_access allow good
acl advance src "/usr/local/squid/etc/advance"
acl advwork time SMTWHFA
http_access allow advance advwork
http_access deny all
建立日志文件
touch /usr/local/squid/var/logs/access.log
touch /usr/local/squid/var/logs/cache.log
touch /usr/local/squid/var/logs/store.log
chmod 777  /usr/local/squid/var/logs/access.log
chmod 777 /usr/local/squid/var/logs/cache.log
chmod 777 /usr/local/squid/var/logs/store.log
ee /usr/local/squid/etc/game
61.141.194.203
61.144.238.145
61.144.238.146
61.144.238.149
61.144.238.155
61.172.249.135
65.54.229.253
202.96.170.164
202.104.129.151
202.104.129.251
202.104.129.252
202.104.129.253
202.104.129.254
211.157.38.38
218.17.209.23
218.17.209.42
218.17.217.106
218.18.95.153
218.18.95.165
219.133.40.21
219.133.40.73
219.133.40.89
219.133.40.90
219.133.40.92
219.133.40.95
219.133.40.97
219.133.40.157
219.133.40.177
219.133.40.189
ee /usr/local/squid/etc/bad
.ourgame.com
ad4.sina.com.cn
ee /usr/local/squid/etc/good
.ourgame.com
ad4.sina.com.cn
squid# cat good
9981.wx-e.com
.szedu.com
.jscsedu.com
.jsjyt.edu.cn
.jxllt.com
.cs.js.cn
.cctv.com
.sina.com.cn
.wgczx.com
.fxmake.com
.chinaunix.net
.cnfug.org
.freebsdchina.org
.hongen.com
.zhongcai.com
.englishweekly.com
.yahoo.com
.ruiwen.com
.pkuschool.com
ee /usr/local/squid/etc/advance
192.168.1.4
192.168.1.7
192.168.1.8
192.168.1.9
建立缓存目录
mkdir /home/cache
chown –R nobody /home/cache
chgrp –R nogroup /home/cache

测试squid运行是否正常
/usr/local/squid/sbin/squid start
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP