# Cannot connect to network

## shubhamharnal

So I'm really at a loss as to why I'm unable to connect to my network.

Details: My network's on DHCP so all I gotta do is plug in the cable and I'm connected (at least in Windows).

I DO have to provide a proxy address and username/password for the proxy (prolly squid).

My lan card is quickly detected by the live-cd ( I was installing gentoo on a new system ) and I began by setting proxy as detailed in the "Gentoo Handbook":

export http_proxy="http://myproxyusername:myproxypassword@myproxyip:proxyport"

I confirmed that this had been set by running: echo $http_proxy.

Next, I ran net-setup eth0 and simply told the application that eth0 was wired and that I get address from DHCP.

However:

ping -c 3 www.gentoo.org

ping: unknown host gentoo....

here's a run from ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:1e:37:8e:5e:85  

          inet addr:172.18.6.130  Bcast:172.18.6.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:2256 errors:0 dropped:0 overruns:0 frame:0

          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:147415 (143.9 KiB)  TX bytes:3661 (3.5 KiB)

          Memory:fe200000-fe220000

So looks like things are set correctly. Still, I am unable to connect or ping anything  :Sad: 

Please let me know if there's any other information I can provide to help you help me!

Thanks in advance!

----------

## eccerr0r

What are you using for dhcp?

Normally you dhcp client should automatically edit /etc/resolv.conf which tells the resolver what hosts and other configuration to resolve hostnames to IP addresses.

You should see something like 

nameserver x.y.z.a 

in /etc/resolv conf. Depending on what DHCP client you use tells how to configure it to do this....

----------

## idella4

eccerr0r

 *eccerr0r wrote:*   

> 
> 
> My lan card is quickly detected by the live-cd ( I was installing gentoo on a new system )
> 
> 

 

ok, so where are you at??  Is this the early stage of an install pulled up in its tracks by the step connecting to the network failing?

Is the installation done and now you can't connect?  Could you post your /etc/resolv.conf.  There are choices of dhcp clients, so stipulating which is your choice would be valid.

----------

## Hu

Since you mentioned that everything works in Windows, I assume that if you run ping www.gentoo.org from Windows, it works without any tweaking from you.  Is this correct?

Please provide the output of nl /etc/resolv.conf ; ( gawk '/^nameserver / { print $2; }' < /etc/resolv.conf; echo 8.8.8.8 ) | while read n; do dig www.gentoo.org @$n; done.

----------

## shubhamharnal

eccerr0r: What am I using for dhcp? I guess if you're asking which client, the default one that comes with the minimal Gentoo installation cd. I manually tried #dchpcd eth0 too and the ip, subnet, etc. are all allocated correctly but still no connectivity.

idella4: Yup, this fiasco is part of me installing a Gentoo system on from scratch using a minimal gentoo live-cd. And so yes, I have been unable to move past the first step of having connectivity.

nl /etc/resolv.conf:

     1	# Generated by dhcpcd from eth0

     2	# /etc/resolv.conf.head can replace this line

     3	search i2it.com

     4	# /etc/resolv.conf.tail can replace this lin

Hu: Yes, everything works just fine on Windows (except the step where I add proxy details) out of the box.

Regarding your requested command: nl /etc/resolv.conf ; ( gawk '/^nameserver / { print $2; }' < /etc/resolv.conf; echo 8.8.8.8 ) | while read n; do dig www.gentoo.org @$n; done. , I am afraid I couldn't get any output as the minimal live cd does not seem to have "dig" installed.

Thank you so much everybody for your quick response but I'm still in the doldrums. Any more leads/pointers would surely deserve my gratitude.

Thanks!

----------

## madchaz

Are you actually using a proxy?

Unless you really have one, no need to configure it. 

Also, try the following

1: Ping 204.74.99.100  (the IP of gentoo.org). 

If that works, you aren't able to resolve names. Check /etc/resolve.conf and see if you have a valid dns server listed

2: Does ifconfig return a valid IP for your network?

----------

## Hu

 *shubhamharnal wrote:*   

> 
> 
> ```
> nl /etc/resolv.conf:
> 
> ...

 That looks like a problem.  Your DHCP server should have configured a DNS server for you.  For now, you can manually set one by adding a nameserver line.  Long term, you will need to either edit the resolv.conf.tail file to force one to be included or get the network administrator to fix the DHCP server so that it hands out DNS server addresses.  I suspect they left it out because they wrongly believed that no one would need name service because "everything should just go through the proxy"; unfortunately, that is not true, since the proxy likely does not handle ICMP.

----------

## shubhamharnal

OK I'm going to give this a shot by manually editing the resolv.conf file.

Will keep you posted on the outcome.

Thanks!

----------

## idella4

shubhamharnal

That's a worry.  If you're at step one, that means the gentoo minimal install generated a faulty /etc/resolv.conf. First time I've seen that, but I haven't had to setup a proxy since pre 2006, they're a hassle.  You've been a good while now.  Getting a setup should be a basic task now; have a knoppix or some other linux distro to boot into & generate a viable /etc/resolv.conf?

----------

## shubhamharnal

Sorry I'm caught up in shcool work. I'll give it a go sometime today and get back to you as soon as conveniently possible.

Thanks!

----------

## shubhamharnal

So still playing around with network settings and was trying to obtain DNS server ip so ran ipconfig /all from windows.

It doesn't show any DNS ip! But does show something like a DNS-suffix set to i2it.com

http://imgur.com/O9cH9

Obviously I can surf from Windows (XP).

Next I'm going to try some other distro and see if they can handle this.

Meantime any leads would be appreciated.

Thanks.

----------

## FizzyWidget

add 

```
nameserver 208.67.220.220

nameserver 208.67.200.200
```

to /etc/resolv.conf - they are dns servers for opendns, they should get you up and running

----------

## shubhamharnal

 *idella4 wrote:*   

> shubhamharnal
> 
> That's a worry.  If you're at step one, that means the gentoo minimal install generated a faulty /etc/resolv.conf. First time I've seen that, but I haven't had to setup a proxy since pre 2006, they're a hassle.  You've been a good while now.  Getting a setup should be a basic task now; have a knoppix or some other linux distro to boot into & generate a viable /etc/resolv.conf?

 

So the opendns thing didn't work but HERE'S SOMETHING VERY INTERESTING:

Even though I have been unable to connect from the terminal, I AM being able to connect through the links browser.

Simply fired links, set the proxy:port via setup->networking options->proxies and viola! I could open web pages by providing the url to links.

Since I didn't do any manual setup for this, obviously something is messed up on the terminal with respect to being able to set proxies.

I guess its a bug then?

I'd like to be able to help out with more diagnostics and possibly fixing the bug, if someone can help/lead me through it.

Waiting for some positive response...

Thanks!

----------

## Hu

What operations fail from the command line?  You have showed us that ping by name fails.  It is possible that the local network configuration has no working DNS servers and a firewall to prevent use of external DNS.  If you can start lynx with the environment variable http_proxy set to the proper value and get a working browser, then the observed conditions are fully consistent.  In that case, you should begin installing the system with the environment variable set, so that wget can download distfiles for you via the proxy.  Ignore the inability to use ICMP.  Ping expects to resolve names on its own, and if your network's DNS is unavailable and the administrator blocked external DNS servers, you will not be able to resolve names.

----------

## shubhamharnal

 *Hu wrote:*   

> What operations fail from the command line?  You have showed us that ping by name fails.  It is possible that the local network configuration has no working DNS servers and a firewall to prevent use of external DNS.  If you can start lynx with the environment variable http_proxy set to the proper value and get a working browser, then the observed conditions are fully consistent.  In that case, you should begin installing the system with the environment variable set, so that wget can download distfiles for you via the proxy.  Ignore the inability to use ICMP.  Ping expects to resolve names on its own, and if your network's DNS is unavailable and the administrator blocked external DNS servers, you will not be able to resolve names.

 

WORKING! So yes, setting the http_proxy environment variable does the trick! 

So there was much ado about nothing really. Everything works out fine; its just that PING's ICMP packets seem to attempt DNS of their own which fails.

The Gentoo Handbook DOES NEED CORRECTION/EDITING though!

I got sucked into the problem because the way the gentoo handbook asks you to test out your network: http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?style=printable&full=1#book_part1_chap3

 *Quote:*   

> Testing the Network
> 
> You may want to try pinging your ISP's DNS server (found in /etc/resolv.conf) and a Web site of your choice, just to make sure that your packets are reaching the net, DNS name resolution is working correctly, etc.
> 
> Code Listing 1.4: Further network testing
> ...

 

The only test mentioned is pinging a host. Since pinging from behind a proxy could potentially fail( as in my case ), the handbook should also suggest that if pinging fails, then one should also try wget and links to test out if the network is working.

Off to my install!...

Thanks everybody. THIS FORUM and the EXCELLENT SUPPORT is why I'm a Gentoo-er!

----------

## Hu

It is very rare that you will have the technical and administrative permission to install Gentoo in a network which has been locked down to the point that IT refuses to run and announce working nameservers.  Such networks are typically removed from the Internet entirely or are fully managed by the IT staff (such that installing your own system violates policy).  Additionally, many other programs assume the presence of working name service, so your trials may not end here.

----------

