LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: Sadam

在局域网里,gentoo安装过程中怎么设置代理服务器?

[复制链接]
 楼主| 发表于 2003-6-22 18:04:46 | 显示全部楼层
呵呵,你是中大的吧,看你的 IP     sync 必须使用 socks 代理才出得去的     你可以使用 dante 或 socksv5r11,前者好找,推荐使用前者, 可以简单的 emerge 的    安装完了dante,修改一下 etc 下的配置文件,指定你的socks 代理, 如 61.143.16.21 端口是 1080, 不是 3128, 也可以在配置文件中设置用户名和密码的,当然你也可以用 211.56.138.33 的 1080   


我笨。请问修改 etc 下的哪个配置文件呀? 还有,这 etc 是指原来系统(我得是redhat)还是指/mnt/gentoo/etc ?

我现在可以通过代理 wget, 但是还是无法 emerge.
 楼主| 发表于 2003-6-22 18:32:42 | 显示全部楼层
在redhat里装了dante,找到redhat的/etc/socks.cof,不知如下配置对不对:

# $Id: socks-simple.conf,v 1.3 2000/09/25 07:47:55 michaels Exp $
#
# A simple sample socks.conf for users with a local nameserver.

# clients going anywhere go via the proxyserverserver listening at
# ipaddress 10.1.1.1, port 1080.  Uncomment the line(s)
# corresponding to the proxyprotocols your proxyserver supports.
#route {
#        from: 0.0.0.0/0   to: 0.0.0.0/0   via: 10.1.1.1 port = 1080
#        proxyprotocol: socks_v5         # server supports socks v5.
#        proxyprotocol: socks_v4         # server supports socks v4
#        proxyprotocol: http_v1                 # server supports http v1
#        proxyprotocol: msproxy_v2        # server supports msproxy v2
#}

route {
        from: 0.0.0.0/0   to: 0.0.0.0/0   via: 211.56.138.33 port = 1080
        proxyprotocol: socks_v5         # server supports socks v5.
        proxyprotocol: socks_v4         # server supports socks v4
        proxyprotocol: http_v1                 # server supports http v1
        proxyprotocol: msproxy_v2        # server supports msproxy v2
}
发表于 2003-6-22 22:01:06 | 显示全部楼层
你要在 chroot 后的 gentoo 环境里面安装 dante 的

如果你是用 emerge 安装的,则配置文件在 /etc/socks/ 目录下

建议你在安装 gentoo 时,使用 emerge-webrsync, 这个只要设置了 http 和 ftp proxy 就可以下载一个 snapshot 下来,等到真正安装好你自己的 gentoo 后,再在正中安装 dante

呵呵,我也是中大的
发表于 2003-6-22 22:03:37 | 显示全部楼层

我的配置文件, 要按你的情况修改的

# $Id: socks.conf,v 1.28 2001/12/12 13:56:42 karls Exp $
#
# A sample socks.conf

# The configfile is divided into two parts; first misc. settings,
# then the routes.  Objects in '[]' are optional.
#
#
# recommended order is:
#        [debug]
#        [logoutput]
#        [resolveprotocol]
#
#        routes:
#                from to via
#                [command]
#                [extension]
#                [protocol]
#                [proxyprotocol]


debug: 1           # uncomment to enable debugging

#logoutput: stdout  # users usually don't want to be bothered with that.

# What protocol should be used for resolving hostnames?  It's important
# to set this right.
#resolveprotocol: udp  # default
#resolveprotocol: tcp  # set this if your socksserver only supports socksv4.
#resolveprotocol: fake # set this if your clients can't access nameserver,
                       # neither directly nor proxied.



#
# the routes
#

# specifying routes for accepting remote connections (via bind()) is
# difficult since we can't know what the "to:" address is
# until we actually get the connection  Since we support letting
# the client accept connections both via the proxyserver and
# "directly" at the same time, we have two options though:
# a) specify a route for bind (only) first going via the proxyserver.
#    This will also handle "direct" connections.
# b) specify a route for bind (only) first going "direct".
#    This means clients will only be able to accept "direct"
#    connections.

# we want to accept remote connections via the proxyserver.
#route {
#        from: 0.0.0.0/0 to: 0.0.0.0/0 via: 10.1.1.1 port = 1080
#        command: bind
#}

# we do not want to accept remote connections via the proxyserver.
#route {
#        from: 0.0.0.0/0 to: 0.0.0.0/0 via: direct
#        command: bind
#}


# if you don't route all local connections via direct, you should
# at least route nameserver connections via direct connections if you
# can.  That can make for much better performance, depending on
# your setup.  Make sure the nameserver line is the first.
#
# Assuming your nameserver runs on address 10.1.1.1, you can do it like this:
route {
        from: 0.0.0.0/0 to: 202.116.64.2/32 port = domain via: direct
}


# have a route making all connections to loopback addresses be direct.
route {
        from: 0.0.0.0/0   to: 127.0.0.0/8  via: direct
        command: connect udpassociate # everything but bind, bind confuses us.
}

route {
        from: 0.0.0.0/0   to: 192.168.0.0/16   via: direct
}

# clients going anywhere else go via server listening at
# IP address 10.1.1.1, port 1080.   Note that unless you have
# specified a direct connection for DNS, or the socksserver is resolvable
# without network traffic, you can't give a hostname for the socksserver,
# you must give a IP address.  (the reasons for that are logical enough,
# you would create a loop otherwise.)
route {
        from: 0.0.0.0/0   to: 0.0.0.0/0   via: proxy2.zsu.edu.cn port = 1080
        protocol: tcp udp                # server supports tcp and udp.
        proxyprotocol: socks_v5 # server supports socks v4 and v5.
        method: none #username                 # we are willing to authenticate via
                                         # method "none", not "username".
}
发表于 2003-6-23 11:29:10 | 显示全部楼层
以后设置代理这些的,看这个帖子就全搞定!
发表于 2003-6-23 12:41:55 | 显示全部楼层
我没看明白~~~
是不是说,
1, sync需要支持sock5的代理。
2, emerge可以用环境变量http_proxy/ftp_proxy
??????????????????????
我记得以前在wgetrc里设置好代理就可以emerge的,但现在不行了。
emerge 时总提示要先emerge sync。用emerge sync的话,又老是有错,
发表于 2003-6-23 12:47:30 | 显示全部楼层
在不能emerge sync的时候,可以用emerge websync,甚至可以自己去下载一个最新的 portage tree,覆盖原来stageX带的那个。
 楼主| 发表于 2003-6-23 14:46:19 | 显示全部楼层
route
{  from: 0.0.0.0/0 to: 127.0.0.0/8 via: direct  command: connect udpassociate }  
route
{  from: 0.0.0.0/0 to: 202.116.64.2/32 port = domain via: direct  }
route {  from: 0.0.0.0/0 to: 192.168.0.0/16 via: direct  }   


请问这三行各代表什么意思? 192.168.0.0/16 这"/"前后分别是什么?[QUOTE]
发表于 2003-6-23 17:39:54 | 显示全部楼层
前面是IP地址,后面是字网掩码,16 等价于 255.255.0.0,24等价于 255.255.255.0
这三行前面都有注释的啊,他们都是可以不需要代理,可以direct连接上的
 楼主| 发表于 2003-6-23 20:47:05 | 显示全部楼层
我的子网掩码是 255.255.252.0 ,那怎么办?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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