# Emerge sync and more using a SOCKS proxy HOWTO

## dberkholz

This howto describes how to setup a SOCKS client for emerging. I had an incredibly difficult time making this work, so I want to make it easier for anyone else trying. I used tsocks (emerge tsocks) as my SOCKS client for a SOCKS v5 server. Note that I also have DNS, HTTP and FTP proxies set up. Some people need to use a specific rsync server IP address as the DNS information does not make it through.

in /etc/make.conf

```
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"

FTP_PROXY="ftp://192.168.0.1:8000"

HTTP_PROXY="http://192.168.0.1:80"

#RSYNC_PROXY="192.168.0.1:873"
```

Notice that RSYNC_PROXY is commented out. This is critical.

in /etc/socks/tsocks.conf

```
# We can access 192.168.0.* directly

local = 192.168.0.0/255.255.255.0

# Otherwise we use the server

path {

reaches = 0.0.0.0/0

server = 192.168.0.1

server_type = 5

default_user = test

default_pass = test

}
```

192.168.0.1 is the SOCKS server. The default_user and default_pass fields were required to make this work; the test:test combination is meaningless and could be anything.

----------

## mog

cool  :Laughing:  ... I'll use this for now ... but there are a couple of things where tsocks is not as powerful as dante ... could anyone with experience post how to do a similar thing with dante ... I had a really hard time finding anything useful on dante configuration

----------

## CustardFD

There is a very detailed dante sample config in /usr/doc/dante*/example/socks.conf.gz.  There are so many comments and examples for more complex configurations (such as ms-proxy, http tunneling, etc) that I've stripped all the comments out.

My config at uni (in /etc/socks/socks.conf) is:

```
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: 10.0.0.0/8   via: direct

}

route {

   from: 0.0.0.0/0   to: 128.240.0.0/8  via: direct

}

route {

   from: 0.0.0.0/0   to: 0.0.0.0/0   via: 128.240.229.66 port = 1080

   protocol: tcp udp

   proxyprotocol: socks_v4 socks_v5

   method: none

}

```

The 10.0.0.0/8 and 128.240.0.0/16 subnets are on the local network and do not need to go though the socks proxy.

----------

## mog

thanks a buch    :Very Happy:    .... I must have been looking in the wrong places that I missed that    :Laughing: 

----------

## foulsoul

how do i use a socks proxy that isn't on my LAN? I mean through my 192.168.0.1 internet gateway and then through a socks4 proxy? (its to get better bandwidth)

----------

## potatoface

 *foulsoul wrote:*   

> how do i use a socks proxy that isn't on my LAN? I mean through my 192.168.0.1 internet gateway and then through a socks4 proxy? (its to get better bandwidth)

 

i have no problems with mozilla or firefox to connect to the internet trough the socks proxy but how do i tell portage, wget , lynx or konqueror to do this, too?

----------

## Grimi

Well, its a little bit dusty here but i give it a try.

 *potatoface wrote:*   

> i have no problems with mozilla or firefox to connect to the internet trough the socks proxy but how do i tell portage, wget , lynx or konqueror to do this, too?

 

This i'm asking me for ages!! (especially for konqueror) 

any advice would be cool   :Cool: 

----------

