论坛风格切换切换到宽版
  • 1392阅读
  • 7回复

[问题求助]内网做对外服务器出现的问题 [复制链接]

上一主题 下一主题
离线liuxiao30.
 
发帖
2037
C币
-140620
威望
363
贡献值
1
银元
-1
铜钱
4544
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
网络结构为:一台linux服.务器,双网卡,一块接大.网,一块接局域网,接大网网卡有固定的大网IP             汽车

实现目标:当大网用户访问该liunx服务器的大网IP时,直接转向到局域网的另一台.W.EB服务器上            建材
参照以前的帖子:
假定内IP提供服务的主机IP为1.1.1..1,提.供互联网代理的主机外网IP为2.2.2.2.

/s.bin/iptables. -t nat -A POSTROUTING -s 1.1.1.1 -o eth0 -j SN.AT --to 2.2.2.2(        游戏          )
/sbin/iptables -t nat -A PR.EROUTIN.G -p tcp -d 2.2.2.2 --dport 80 -i eth0 -j DNAT --to .1.1.1.1.


结果出现错误:
ERROR
The requeste.d URL .could not be retrieved.

--.---.-------------------------------------------------------------------------.----- 印刷

While trying .to r.etrieve the URL: / .

The following.. error was encountered: 服务器

Invalid URL
Some aspect of the requested URL is incorr.ec.t. Possible problems: .

Missing or incorrect access protocol (should be `http://'' or similar)     美容
Mis.sing hostname 投资
Illeg.al double-.escape in the URL-Path 虚拟主机
Illegal character in hostname; underscores are n.ot. allowed .
You.r cache adminis.trator is root.     健康



---------.---------------------------------.--.------------------------------------.
Generated Mo.n, 22 Jan 2007 01:13:37 GMT by localh.ost (Squid/2.4.STABLE7)     外汇

请问是什么原因?

squid如下:

visib.le_hostna.me localhost             汽车
http_port 80
cache_m.em 76 MB           女人
c.ache_swap_low 80健康
ca.che_swap_high 95电脑

hierarchy_sto.plist cgi-bin. ?.
half_closed_.clients off          婚庆
hierarchy_stoplist .-i ^h.ttps:\\ ?电影
acl QUERY urlpath_rege.x -i cgi-bin \? \.asp \.php \.jsp. \.cgi域名
acl denyssl urlpath_rege.x -i .^https:\\外贸
no_c.ache deny QUERY.
no_cache deny d.enyssl

ipca.che_size 1024           鲜花
ipcache_low 90
ipc.ache_high 95          婚庆
fqdncache._size 1024(        游戏          )

ftp_user .Squid@外贸
ftp_passive on

acl all src. 0.0.0.0/0..0.0.0投资
acl localhost src 127..0.0.1/255.255.255.255.(        游戏          )
acl manager proto cach.e_obj.ect              乙肝

acl Sa.fe_.ports port 80 # http(        游戏          )
acl Safe_ports p.ort 21 #. ftp学习
acl Safe_.ports port 443 563 # ht.tps, snews
acl Saf.e_ports port 70 # go.pher<性病>
a.c.l Safe_ports port 210 # wais虚拟主机
#acl Safe_ports port 1025-.65535 # unregiste.red ports外贸
acl Safe._ports port 280 # http-mg.mt<性病>
acl. Safe_ports port 488 # gss-.http.
a.cl Saf.e_ports port 591 # filemaker健康
a.cl Safe_ports port 777 # multiling. http           鲜花
http_access .deny .!Safe_ports电影

acl .SSL_ports port 443 5.63 8601投资
acl CONNECT met.hod .CONNECT             电子
# Deny CONNECT. to othe.r than SSL ports           建材
h.ttp_access deny CONNECT !.SSL_ports教育

# Only allow .cachemgr access from localh.ost<性病>
htt.p_access allow manager loc.alhost             电子
htt.p_access deny manager.

http_.access allow localhos.t.

# And finally deny all other. access. to this proxy              乙肝
#never_direct allo.w all(        游戏          )


acl. ken src 1.1.1.2.
http_acce.ss allow ken    健康



http_access de.ny all.


icp_a.ccess allow all            杀毒

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线brokenfly.
发帖
1941
C币
-152808
威望
364
贡献值
1
银元
-2
铜钱
4383
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
请大家帮忙看一下,很长 时间了

离线tomsina.
发帖
2065
C币
-140211
威望
356
贡献值
1
银元
-1
铜钱
4481
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
#iptables -t nat -A PREROUTING -i eth0 -p tcp -d 2.2.2.2 --dport 80 -j DNAT --to-destination 1.1.1.1

是不是--to-destination.因为在所看到的资料上看到不同的内容。所以也不敢确定。可能是笔误也说不定。

离线lzzsgsb.
发帖
2008
C币
-262851
威望
381
贡献值
7
银元
3
铜钱
4528
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
你现不用透明代理的方式测试一下SQUID,SQUID的机器访问网络正常吗,是不是有SQUID的转发环路出现。

离线啊锐.
发帖
1953
C币
-60757
威望
356
贡献值
1
银元
-2
铜钱
4337
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13


QUOTE:原帖由 ahking 于 2007-2-7 13:54 发表于 1楼  
While trying to retrieve the URL: /

The following error was encountered:

Invalid URL
Some aspect of the requested URL is incorrect. Possible problems:


这不是 squid 于 transparent proxy 设定的 faq 呼 ?

http://man.chinaunix.net/newsoft/squid/Squid_FAQ/FAQ-17.html

--

离线beleen.
发帖
2112
C币
-60346
威望
394
贡献值
1
银元
-1
铜钱
4715
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
squid中没有启用透明代理啊!
怎样判断转发回路是否存在?

离线kaerdd.
发帖
2017
C币
-549385
威望
385
贡献值
3
银元
0
铜钱
4377
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-13
我修改了端口,squid不报错了,但提示无法找到服务器
/sbin/iptables -t nat -A POSTROUTING -s 1.1.1.1 -o eth0 -j SNAT --to 2.2.2.2
/sbin/iptables -t nat -A PREROUTING -p tcp -d 2.2.2.2 --dport 8000 -i eth0 -j DNAT --to 1.1.1.1:8000

发帖
2063
C币
-60532
威望
431
贡献值
1
银元
-1
铜钱
4810
人人网人气币
0
只看该作者 7楼 发表于: 2010-04-13


QUOTE:原帖由 ahking 于 2007-2-14 11:35 发表于 7楼  
我修改了端口,squid不报错了,但提示无法找到服务器
/sbin/iptables -t nat -A POSTROUTING -s 1.1.1.1 -o eth0 -j SNAT --to 2.2.2.2
/sbin/iptables -t nat -A PREROUTING -p tcp -d 2.2.2.2 --dport 8000 - ...


squid faq 已经告诉你 transparent proxy 要改哪些组态了...

http://man.chinaunix.net/newsoft/squid/Squid_FAQ/FAQ-17.html

你设定档案来看,是没有调整支援到 transparent proxy 所需参数配置。

还有一个问题不要到处张贴,因为回覆的时候到底要贴哪篇呢 ?

--
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个