# emerge over proxy [solved]

## 118947

Hi! I`m currently trying to reinstall gentoo on my machine. The only way I can currently acsses the internet is via a proxy.

Now using windows, I had to set everything to dhcp and automatic configuration + adding a line to the connection settings in my browser to point it at a certain "proxy.pac" file residing on the dhcp server. everything works.

Now, back to gentoo. I don't seem able to get emerge working. I always get the error "cannot resolv hostname...etc"

I also can't ping, for instance, google. Hence I believe that my connection is not setup right.

I've added the line

```
iface_eth0="dhcp"
```

to /etc/conf.d/net.

I (using the live cd) did net-setup eth0, set it to dhcp, and copied over the nameserver addresses in /etc/resolv.conf to my actual resolv.conf. BTW, I can't ping using the live cd either.

Now I've read about doing

```
echo http_proxy="www.myserver.de:port" >> /etc/env.d/proxy
```

or doing

```
export http_proxy=""http://myserver.de:port"
```

or adding the above line to /etc/profile. 

Nothing works. 

Help. I'm stuck right down at trying to emerge sysklogd and seriously, that isn't gentoo   :Crying or Very sad: Last edited by 118947 on Wed Nov 09, 2005 8:39 pm; edited 1 time in total

----------

## think4urs11

Hi,

you might need to check the content of the proxy.pac file to find out the correct settings for your proxy.

This can be done e.g. by downloading the pac file to disk and checking for "PROXY w.x.y.z" lines.

This statement is what you need for your export http_proxy.

Easy way in windows would be to use telnet to get the PAC if downloading isn't possible directly.

- telnet 'server address' 80 (opens a connection to web server which holds the pac)

- type GET proxy.pac

- check result for PROXY statements

HTH

T.

----------

## 118947

here :

```
function FindProxyForURL(url, host)

{

  if (isPlainHostName(host)

      || dnsDomainIs(host, ".xxx")) {

   return "DIRECT";   

  }

  if (shExpMatch(url,"http://localhost*") || shExpMatch(url,"http://127.0.0.1*")) {

   return "DIRECT";   

   }

  if (shExpMatch(url,"http://141.26.128.*")) {

   return "DIRECT";   

   }

  if (shExpMatch(url,"*://xxx2*")) {

   return "DIRECT";

  }

  if (dnsDomainIs(host, ".de"))

     return "PROXY xxx3.de:3128; PROXY xxx3:3129; DIRECT"; 

  return "PROXY xxx3:3129; PROXY xxx3:3128; DIRECT";

}
```

----------

## anunakin

Open /etc/profile and put this lines:

```
vi /etc/profile
```

```
export http_proxy="http://YOURPROXYSERVER:PROXYPORTNUMBER"

export https_proxy="http://YOURPROXYSERVER:PROXYPORTNUMBER"

export ftp_proxy="http://YOURPROXYSERVER:PROXYPORTNUMBER"

#Servers to not use proxy

export no_proxy="localhost,server007,intranet,.internalnetwork.int,10.0.0.0"
```

Run env-update, and source /etc/profile 

```
env-update

source /etc/profile
```

This works fine to a proxy with basic authentication, like SQUID, APACHE (mod_proxy) and others, but if u run behind a M$-ISA Server u go need install and configure the package ntlmaps, this goes make u auth in ISA Server.... 

This works fine with emerge, wget and others  :Wink: 

----------

## think4urs11

additionally for rsync you need to add

```
export RSYNC_PROXY="yourproxy:proxyport"
```

 :Exclamation:  your proxy needs to support/allow the http CONNECT method on port 873/tcp for this

(normally this isn't default on proxies, so you might need the university admins to reconfigure it for you)

----------

## anunakin

yeap, if u dont have the 873/tcp port, opened on u proxy... u can use

```
emerge-webrsync
```

----------

## 118947

Ok, thanks for the help. I've managed to configure 'everything' to work.

I have however, two more questions:

first, I've installed dhcpcd, but in order to get it to configure my network for me, I have to manually run it. How can I automate the process, to get it to run  at boot time?

second, it seems as though the 873/tcp port is blocked.

```
emerge --sync
```

doesn't work. 'Normal'  emerging works though (I mean downloading packages works).

I tried the command

```
emerge-webrsync
```

and it basicly did the portage update. Then I was told to emerge a new version of portage  and to update ALL my configs (this is not new to me). I then did a 

```
etc-update
```

 which would normally merge my configs (using emerge --sync!). However I just got the 

```
...nothing left to do...
```

Is this normal, do I need to update my config by hand !?!   :Sad: 

----------

